[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 2008-07-21T02:08:31-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/2717 2008-07-21T02:08:31-05:00 2008-07-21T02:08:31-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17478#p17478 <![CDATA[program help (if you have a free sec)]]>
In Linux this'd be easy

Code:

shutdown -h now
.

grtz

Statistics: Posted by Seb McClouth — Mon Jul 21, 2008 2:08 am


]]>
2008-07-20T22:24:20-05:00 2008-07-20T22:24:20-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17477#p17477 <![CDATA[program help (if you have a free sec)]]>
Thanks all for your posts. It works now.
I just have to test it now by putting it in startup. (I could make it user specific, but since i'm the only user on my machine, startup works.)

Rock on...
Agent_Firestalker

Statistics: Posted by Agent_Firestalker — Sun Jul 20, 2008 10:24 pm


]]>
2008-07-19T09:03:45-05:00 2008-07-19T09:03:45-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17475#p17475 <![CDATA[program help (if you have a free sec)]]>
FOR count = 1 TO num
INPUT #1, verse$
INPUT #1, reference$
NEXT count
resolve into a problem since in the txt-file, it's written like
everyone has sinned, rom 2:20
Wouldn't it have to be sumfin like

Code:

FOR count = 1 TO num INPUT #1, verse$, reference$ NEXT count
grtz

Statistics: Posted by Seb McClouth — Sat Jul 19, 2008 9:03 am


]]>
2008-07-18T12:10:47-05:00 2008-07-18T12:10:47-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17474#p17474 <![CDATA[I dunno]]>
It is important that you not pass the End Of File. I usually use:

DO WHILE NOT(EOF(1))

You could also use: IF NOT(EOF(1)) THEN INPUT #1, verse$

Ted

Statistics: Posted by burger2227 — Fri Jul 18, 2008 12:10 pm


]]>
2008-07-18T10:14:45-05:00 2008-07-18T10:14:45-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17473#p17473 <![CDATA[program help (if you have a free sec)]]>

Statistics: Posted by Ralph — Fri Jul 18, 2008 10:14 am


]]>
2008-07-17T17:31:25-05:00 2008-07-17T17:31:25-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17472#p17472 <![CDATA[program help (if you have a free sec)]]> ).

Statistics: Posted by Dav — Thu Jul 17, 2008 5:31 pm


]]>
2008-07-17T17:27:05-05:00 2008-07-17T17:27:05-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17471#p17471 <![CDATA[program help (if you have a free sec)]]>
Thanks, Dav

Statistics: Posted by Agent_Firestalker — Thu Jul 17, 2008 5:27 pm


]]>
2008-07-17T17:25:00-05:00 2008-07-17T17:25:00-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17470#p17470 <![CDATA[close/re-open file]]>
There are several ways to fix the code. Probably the easiest way without re-writing a bunch is to just add " SEEK #1, 1 " after the FOR/NEXT that steps through all the lines. That will put the file pointer to the beginning of the OPENed file, so when INPUT is called again it will be back at the beginning of the verses.txt file.

- Dav

Statistics: Posted by Dav — Thu Jul 17, 2008 5:25 pm


]]>
2008-07-17T13:06:22-05:00 2008-07-17T13:06:22-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=17468#p17468 <![CDATA[program help (if you have a free sec)]]>
It randomly picks a verse from the file verses.txt (see bottom of post for txt sample) and then asks you for the reference. It lowercases the refernce and compares it to the reference (ref's follow verses in txt file)
You must get three right to close the program.

(On a side note, if I put this in my startup folder and have three wrong guess cause a logoff, can QB run XP's logoff and shutdown commands?)


RANDOMIZE TIMER

'open file
OPEN "c:\qbasic\verses.txt" FOR INPUT AS #1

'clear variable "count"
count1 = 0
count2 = 0

start: CLS
'randomly determine which line of file to read
num = INT(RND * 3) + 1

'skips through file to specified line
FOR count = 1 TO num
INPUT #1, verse$
INPUT #1, reference$
NEXT count

'the verse display and user prompt
PRINT verse$
PRINT
INPUT " Reference?: "; guess$

'if verse # selected (count) is same as last one/two used, get another number
'(start over)
IF count = used1 OR count = used2 THEN GOTO start

'stores used verses so no verse is used twice
IF count1 = 0 THEN count = used1
IF count1 <> 0 AND count2 = 0 THEN count = used2

'checking guess with reference
guess$ = LCASE$(guess$)

IF guess$ = reference$ THEN PRINT : PRINT "Correct!": SLEEP 2: correctnum = correctnum+1
IF guess$ <> reference$ THEN PRINT : PRINT "wrong": GOTO start
IF correctnum = 3 THEN PRINT "Nice job!"
IF correctnum < 3 THEN GOTO start

verses.txt (sample, verses aren't real)
everyone has sinned, rom 2:20
Jesus loves you, matt 12:1
pray often, john 14:1
in the beginning, gen 1:1


If anything is unclear, post your questions.
Thanks for your time,
Agent_Firestalker

Statistics: Posted by Agent_Firestalker — Thu Jul 17, 2008 1:06 pm


]]>