[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2005-11-02T18:13:26-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/1122 2005-11-02T18:13:26-05:00 2005-11-02T18:13:26-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=9086#p9086 <![CDATA[I need help with these programs.....]]> Statistics: Posted by Guest — Wed Nov 02, 2005 6:13 pm


]]>
2005-11-02T17:05:43-05:00 2005-11-02T17:05:43-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=9077#p9077 <![CDATA[I need help with these programs.....]]> Statistics: Posted by Kyle — Wed Nov 02, 2005 5:05 pm


]]>
2005-11-02T16:38:23-05:00 2005-11-02T16:38:23-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=9073#p9073 <![CDATA[I need help with these programs.....]]> My teacher told me to use them but i dont know what they do....and when i get rid of them the program just prints the black scren......can someone help me??? * She also told me to use bns at the bottom of the program....what is that for and can i ghet rid of that??? *



CLS
FOR q = 10 TO 99
FOR p = 10 TO 99

c$ = LTRIM$(RTRIM$(STR$(q * p)))


u$ = LEFT$(LTRIM$(RTRIM$(STR$(q))), 1) 'factor 1 byte 1
d$ = RIGHT$(LTRIM$(RTRIM$(STR$(q))), 1) 'factor 1 byte 2
t$ = LEFT$(LTRIM$(RTRIM$(STR$(p))), 1) 'factor 2 byte 1
q$ = RIGHT$(LTRIM$(RTRIM$(STR$(p))), 1) 'factor 2 byte 2

bc$ = ""

IF q$ + t$ + d$ + u$ = c$ OR q$ + t$ + u$ + d$ = c$ OR q$ + d$ + t$ + u$ = c$ THEN bc$ = c$
IF q$ + d$ + u$ + t$ = c$ OR q$ + u$ + t$ + d$ = c$ OR q$ + u$ + d$ + t$ = c$ THEN bc$ = c$
IF t$ + q$ + d$ + u$ = c$ OR t$ + q$ + u$ + d$ = c$ OR t$ + d$ + q$ + u$ = c$ THEN bc$ = c$
IF t$ + d$ + u$ + q$ = c$ OR t$ + u$ + q$ + d$ = c$ OR t$ + u$ + d$ + q$ = c$ THEN bc$ = c$
IF d$ + q$ + t$ + u$ = c$ OR d$ + q$ + u$ + t$ = c$ OR d$ + t$ + q$ + u$ = c$ THEN bc$ = c$
IF d$ + t$ + u$ + q$ = c$ OR d$ + u$ + q$ + t$ = c$ OR d$ + u$ + t$ + q$ = c$ THEN bc$ = c$
IF u$ + q$ + t$ + d$ = c$ OR u$ + q$ + d $ + t$ = c$ OR u$ + t$ + q$ + d$ = c$ THEN bc$ = c$
IF u$ + t$ + d$ + q$ = c$ OR u$ + d$ + q$ + t$ = c$ OR u$ + d$ + t$ + q$ = c$ THEN bc$ = c$

IF bc$ <> "" AND INSTR(bns$, bc$) = 0 THEN bns$ = bns$ + bc$: PRINT q; "x"; p; "= "; bc$

NEXT p
NEXT q

Statistics: Posted by Guest — Wed Nov 02, 2005 4:38 pm


]]>
2005-10-30T12:52:42-05:00 2005-10-30T12:52:42-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8962#p8962 <![CDATA[I need help with these programs.....]]> Statistics: Posted by {Nathan} — Sun Oct 30, 2005 12:52 pm


]]>
2005-10-29T19:23:42-05:00 2005-10-29T19:23:42-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8950#p8950 <![CDATA[I need help with these programs.....]]>
Well how could i make my program shorter and more legable???? Remember ima noobie so i wont understand most the stuff you are talking about unless you explain it. By the way thank you for the help.
By spacing on do..loops, for..nexts, while..wends, and if..then..end if statements as well as subs and functions. If you were a C programmer at one point, you would know the importance of tabbing & spacing for example:
Which is more readable and understandable?

Code:

CLSSCREEN 18DO    PSET(x, y), RND * 15    x = x + 1    y = y + 1LOOP

Code:

CLSSCREEN 18DOPSET(x,y), rnd * 15x = x + 1y = y + 1LOOP

Statistics: Posted by Guest — Sat Oct 29, 2005 7:23 pm


]]>
2005-10-29T19:14:29-05:00 2005-10-29T19:14:29-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8947#p8947 <![CDATA[I need help with these programs.....]]>

Code:

DECLARE FUNCTION num$ (nm&)FOR mul1% = 1 TO 400FOR mul2% = 1 TO 400mstr$ = num$(CLNG(mul1%) * CLNG(mul2%))nstr$ = mstr$m1$ = num$(CLNG(mul1%)): m2$ = num$(CLNG(mul2%))f% = 0FOR i% = 1 TO LEN(m1$)test% = INSTR(nstr$, MID$(m1$, i%, 1))IF test% <> 0 THENMID$(nstr$, test%, 1) = SPACE$(1)f% = f% + 1ELSEEXIT FOREND IFNEXT i%FOR i% = 1 TO LEN(m2$)test% = INSTR(nstr$, MID$(m2$, i%, 1))IF test% <> 0 THENMID$(nstr$, test%, 1) = SPACE$(1)f% = f% + 1ELSEEXIT FOREND IFNEXT i%IF f% = LEN(m1$) + LEN(m2$) THENPRINT mstr$+","+m1$+","+m2$END IFNEXT mul2%NEXT mul1%FUNCTION num$ (nm&)num$ = RIGHT$(STR$(nm&), LEN(STR$(nm&)) - 1)END FUNCTION
At least I like this code better. Everybody else might say otherwise. :P

Statistics: Posted by Zamaster — Sat Oct 29, 2005 7:14 pm


]]>
2005-10-29T18:24:08-05:00 2005-10-29T18:24:08-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8945#p8945 <![CDATA[I need help with these programs.....]]> Statistics: Posted by Guest — Sat Oct 29, 2005 6:24 pm


]]>
2005-10-29T17:23:52-05:00 2005-10-29T17:23:52-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8939#p8939 <![CDATA[I need help with these programs.....]]> [*code]Input Code Here[*/code]
The result:

Code:

Input code here
in a code statement, you can also space as much as you want, so your code will also gain legibility

Statistics: Posted by Guest — Sat Oct 29, 2005 5:23 pm


]]>
2005-10-29T17:08:28-05:00 2005-10-29T17:08:28-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8930#p8930 <![CDATA[I need help with these programs.....]]> Statistics: Posted by Kyle — Sat Oct 29, 2005 5:08 pm


]]>
2005-10-29T17:03:47-05:00 2005-10-29T17:03:47-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8928#p8928 <![CDATA[I need help with these programs.....]]>
The awakened: \\ are backslashes, // are forward slashes :D
Well, whatever. :)

Statistics: Posted by The Awakened — Sat Oct 29, 2005 5:03 pm


]]>
2005-10-29T16:55:56-05:00 2005-10-29T16:55:56-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8926#p8926 <![CDATA[I need help with these programs.....]]> Statistics: Posted by {Nathan} — Sat Oct 29, 2005 4:55 pm


]]>
2005-10-29T16:45:56-05:00 2005-10-29T16:45:56-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8924#p8924 <![CDATA[I need help with these programs.....]]>

Statistics: Posted by Kyle — Sat Oct 29, 2005 4:45 pm


]]>
2005-10-29T13:11:21-05:00 2005-10-29T13:11:21-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8919#p8919 <![CDATA[I need help with these programs.....]]>

-OK! I think i got it tell me if i do.... here is what i wrote

CLS : FOR q = 10 TO 99
FOR p = 10 TO 99

c$ = LTRIM$(RTRIM$(STR$(q * p))) 'candidate product in string

' "parse"
u$ = LEFT$(LTRIM$(RTRIM$(STR$(q))), 1) 'factor 1 byte 1
d$ = RIGHT$(LTRIM$(RTRIM$(STR$(q))), 1) 'factor 1 byte 2
t$ = LEFT$(LTRIM$(RTRIM$(STR$(p))), 1) 'factor 2 byte 1
q$ = RIGHT$(LTRIM$(RTRIM$(STR$(p))), 1) 'factor 2 byte 2

bc$ = ""

IF q$ + t$ + d$ + u$ = c$ OR q$ + t$ + u$ + d$ = c$ OR q$ + d$ + t$ + u$ = c$ THEN bc$ = c$
IF q$ + d$ + u$ + t$ = c$ OR q$ + u$ + t$ + d$ = c$ OR q$ + u$ + d$ + t$ = c$ THEN bc$ = c$
IF t$ + q$ + d$ + u$ = c$ OR t$ + q$ + u$ + d$ = c$ OR t$ + d$ + q$ + u$ = c$ THEN bc$ = c$
IF t$ + d$ + u$ + q$ = c$ OR t$ + u$ + q$ + d$ = c$ OR t$ + u$ + d$ + q$ = c$ THEN bc$ = c$
IF d$ + q$ + t$ + u$ = c$ OR d$ + q$ + u$ + t$ = c$ OR d$ + t$ + q$ + u$ = c$ THEN bc$ = c$
IF d$ + t$ + u$ + q$ = c$ OR d$ + u$ + q$ + t$ = c$ OR d$ + u$ + t$ + q$ = c$ THEN bc$ = c$
IF u$ + q$ + t$ + d$ = c$ OR u$ + q$ + d$ + t$ = c$ OR u$ + t$ + q$ + d$ = c$ THEN bc$ = c$
IF u$ + t$ + d$ + q$ = c$ OR u$ + d$ + q$ + t$ = c$ OR u$ + d$ + t$ + q$ = c$ THEN bc$ = c$

IF bc$ <> "" AND INSTR(dupe$, bc$) = 0 THEN dupe$ = dupe$ + bc$ + SPACE$(1): PRINT q; "x"; p; "= "; bc$

NEXT p
NEXT q

Statistics: Posted by Guest — Sat Oct 29, 2005 1:11 pm


]]>
2005-10-29T12:29:07-05:00 2005-10-29T12:29:07-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8917#p8917 <![CDATA[I need help with these programs.....]]>
1>Does it run a certain amount of times? t = for loop f = 2
2>Does it need to run at least once? t = do loop f = while loop

I think thats it, I couldnt find it...

Statistics: Posted by {Nathan} — Sat Oct 29, 2005 12:29 pm


]]>
2005-10-29T12:09:21-05:00 2005-10-29T12:09:21-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8914#p8914 <![CDATA[I need help with these programs.....]]>
And to the original poster: think about the problem you're trying to solve. Do you know how many times you're going to have to run the loop? If so, you'll want to use a For...Next loop. If you don't know, or you want to run it indefinately, use a do loop.

Statistics: Posted by The Awakened — Sat Oct 29, 2005 12:09 pm


]]>