[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 2013-02-21T02:06:50-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/3695 2013-02-21T02:06:50-05:00 2013-02-21T02:06:50-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22359#p22359 <![CDATA[QuickBasic and Windows XP]]> Statistics: Posted by Pipeliner — Thu Feb 21, 2013 2:06 am


]]>
2013-02-20T21:34:28-05:00 2013-02-20T21:34:28-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22358#p22358 <![CDATA[QuickBasic and Windows XP]]>
Volume in drive C has no label.
Volume Serial Number is E8AA-BB3C

Directory of C:\Documents and Settings\Ted\Basic64\qb64

02/19/2013 12:47 AM 76 COMRIDGE.GAS
02/19/2013 12:47 AM 156 EGPSTD.GAS
02/19/2013 12:47 AM 139 Ggtdesn.gas
02/19/2013 12:47 AM 83 Gilmore3.gas
02/19/2013 12:47 AM 86 MACEDON.GAS
02/19/2013 12:47 AM 78 Moomay89.gas
02/19/2013 12:47 AM 163 Palmvall.gas
7 File(s) 781 bytes
0 Dir(s) 17,224,544,256 bytes free
I took out the folder paths to do that.


Might I suggest "DIR /b *.gas > gasfiles.dir". That will just list the files. Then you can simplify the read code.

Code:

SUB GetGas STATICDIM GasFile$(100), FileHead$(100)inc = 0DefaultDir$ = "" '??????????IF GasGrav > 0 THEN GOTO MissHeadGOSUB headerCOLOR 15: LOCATE 6, 15: PRINT "Before running any programs you must select a gas"LOCATE 8, 15: PRINT "to be used in the flow equations. The gas selected"LOCATE 10, 15: PRINT "can be changed at any time if necessary."COLOR 14LOCATE 12, 15: PRINT "Enter path to directory where gas analysis files are stored"LOCATE 14, 15: PRINT "or press [Enter] to accept default of ";: COLOR 15: PRINT DefaultDir$LOCATE 16, 15: INPUT GasFileDir$: IF GasFileDir$ = "" THEN GasFileDir$ = DefaultDir$FOR i = 6 TO 16 STEP 2  LOCATE i, 15: PRINT "                                                            "NEXT iMissHead:'SHELL "cd " + GasFileDir$SHELL _HIDE "dir /b *.gas > gasfiles.dir" '<<<<<<<<<path?OPEN "gasfiles.dir" FOR INPUT AS #1      '<<<<<<<<<path?j = 1DO UNTIL EOF(1)  LINE INPUT #1, FileName$  GasFile$(j) = FileName$  j = j + 1LOOPCLOSE #1FOR i = 1 TO j  OPEN GasFile$(i) FOR INPUT AS #1  INPUT #1, FileHead$(i)  CLOSE #1NEXT iGOSUB header

Statistics: Posted by burger2227 — Wed Feb 20, 2013 9:34 pm


]]>
2013-02-20T19:56:02-05:00 2013-02-20T19:56:02-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22357#p22357 <![CDATA[QuickBasic and Windows XP]]>
If I run the code in QB4.5 I have the option to run an interpreter which allows me to see what is happening as the code runs through line by line: is there any similar feature available in QB64?

Statistics: Posted by Pipeliner — Wed Feb 20, 2013 7:56 pm


]]>
2013-02-20T18:12:41-05:00 2013-02-20T18:12:41-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22356#p22356 <![CDATA[QuickBasic and Windows XP]]>
If SHELL _HIDE isn't working try adding CMD /C at start of command line.

I don't have that file either. My advise is to get rid of all paths and work with everything in one place until the bugs are ironed out.

Statistics: Posted by burger2227 — Wed Feb 20, 2013 6:12 pm


]]>
2013-02-20T17:42:05-05:00 2013-02-20T17:42:05-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22355#p22355 <![CDATA[QuickBasic and Windows XP]]>
What I think is supposed to happen (bearing in mind it is at least 25 years since I wrote it!) is:

LOCATE 16, 15: INPUT GasFileDir$: IF GasFileDir$ = "" THEN GasFileDir$ = DefaultDir$
This allows the user to select the directory where the *.GAS files are stored: the default directory is C:\CHPROGS.

SHELL "dir " + GasFileDir$ + "\*.gas|sort>" + GasFileDir$ + "\gasfiles.dir"
OPEN GasFileDir$ + "\gasfiles.dir" FOR INPUT AS #1
j = 1
DO UNTIL EOF(1)
LINE INPUT #1, FileName$
FOR i = 1 TO 10
IF MID$(FileName$, i, 1) = " " AND MID$(FileName$, 10, 3) = "GAS" THEN
GasFile$(j) = LEFT$(FileName$, i - 1)
j = j + 1
EXIT FOR
END IF
NEXT i
LOOP
CLOSE #1
What this does is look in GasFileDir$ for all files with a *.GAS extension, and list them alphabetically into a new file called gasfiles.dir . It also loads the corresponding description FileName$ (which is part of the *.gas file) into an array.

CALL Cenprint(5, "Gases on File", 4)
disp: COLOR 13
FOR i = 1 TO 10
IF i + inc > j THEN EXIT FOR
LOCATE 5 + i, 10
PRINT CHR$(i + 64) + ") " + FileHead$(i + inc)
NEXT i

This is supposed to list the available gases in groups of 10: it is at this point that, as far as the screen display is concerned, the whole thing falls down. The first line works just fine, but after that there is nothing displayed on the screen. It just drops down to
COLOR 14: LOCATE 16, 30: PRINT "Press the corresponding letter"
LOCATE 17, 30: PRINT "to select one of these gases,"
LOCATE 19, 30: PRINT "Press [Spacebar] to enter a new gas"
IF GasFile$(i + inc + 1) <> "" THEN LOCATE 21, 30: PRINT "or press [2] for more file gases"

and by hitting Spacebar I can manually enter a gas and the whole thing works fine from then on.

All suggestions gratefully received!

Chris

Statistics: Posted by Pipeliner — Wed Feb 20, 2013 5:42 pm


]]>
2013-02-19T06:19:11-05:00 2013-02-19T06:19:11-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22353#p22353 <![CDATA[QuickBasic and Windows XP]]> Statistics: Posted by Pipeliner — Tue Feb 19, 2013 6:19 am


]]>
2013-02-19T00:56:08-05:00 2013-02-19T00:56:08-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22352#p22352 <![CDATA[QuickBasic and Windows XP]]>

Code:

DIM SHARED Component$(12), X(12)   DIM SHARED a(12), M(12)   'The following parameters are calculated from the above data'in subroutine COMBIN and are used in the AGA 8 equations   DIM SHARED bsij(12, 12), sij(12, 12), eij(12, 12)DIM SHARED gij(12, 12), beij(12, 12)
Change the array portion as shown above. QB64 doesn't like COMMON after DIM.

I also noticed variables named a1, a2, etc. You could use an array to set the values instead of using CONST, but that is up to you:

a(1) = ?????: a(2) = ????

They won't change unless the program changes them.

Statistics: Posted by burger2227 — Tue Feb 19, 2013 12:56 am


]]>
2013-02-18T23:49:12-05:00 2013-02-18T23:49:12-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22351#p22351 <![CDATA[QuickBasic and Windows XP]]> Statistics: Posted by Pipeliner — Mon Feb 18, 2013 11:49 pm


]]>
2013-02-18T22:40:10-05:00 2013-02-18T22:40:10-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22350#p22350 <![CDATA[QuickBasic and Windows XP]]>
Make sure all of the SHELL and OPEN calls work properly! If you want me to check the code send it with the files it will need.

Statistics: Posted by burger2227 — Mon Feb 18, 2013 10:40 pm


]]>
2013-02-18T19:07:27-05:00 2013-02-18T19:07:27-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22349#p22349 <![CDATA[QuickBasic and Windows XP]]>
341SUB Combin
342'**Combining rules for mixing interaction terms**
343DIM gamb(12), epsb(12), sigb(12), U(12, 12), v(12, 12), w(12, 12)
344RESTORE epsdata: FOR i = 1 TO 12: READ epsb(i): NEXT i
345RESTORE sigdata: FOR i = 1 TO 12: READ sigb(i): NEXT i
346RESTORE gamdata: FOR i = 1 TO 12: READ gamb(i): NEXT i
347RESTORE newu: FOR i = 1 TO 12: FOR j = i TO 12: READ U(i, j): U(j, i) = U(i, j): NEXT j: NEXT i
348RESTORE newv: FOR i = 1 TO 12: FOR j = i TO 12: READ v(i, j): v(j, i) = v(i, j): NEXT j: NEXT i
349RESTORE neww: FOR i = 1 TO 12: FOR j = i TO 12: READ w(i, j): w(j, i) = w(i, j): NEXT j: NEXT i
350
351alp = 1 / 3
352FOR j = 1 TO 12
353FOR k = 1 TO 12
354bsij(j, k) = SQR(sigb(j) * sigb(k)) ^ alp
355sij(j, k) = v(j, k) * bsij(j, k)
356epsij = SQR(epsb(j) * epsb(k))
357eij(j, k) = U(j, k) * epsij
358beij(j, k) = w(j, k) * epsij
359gij(j, k) = (gamb(j) + gamb(k)) / 2
360NEXT k
361NEXT j
362ERASE gamb, epsb, sigb, U, v, w
363END SUB


Any thoughts? (NB: the code does not have line numbers - I added them just now to locate where the problem was)

Statistics: Posted by Pipeliner — Mon Feb 18, 2013 7:07 pm


]]>
2013-02-18T18:28:42-05:00 2013-02-18T18:28:42-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22348#p22348 <![CDATA[QuickBasic and Windows XP]]> Statistics: Posted by Pipeliner — Mon Feb 18, 2013 6:28 pm


]]>
2013-02-18T17:59:49-05:00 2013-02-18T17:59:49-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22347#p22347 <![CDATA[QuickBasic and Windows XP]]>
You may want to add _HIDE after SHELL in the command lines.

See the link below

Statistics: Posted by burger2227 — Mon Feb 18, 2013 5:59 pm


]]>
2013-02-18T17:47:29-05:00 2013-02-18T17:47:29-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22346#p22346 <![CDATA[QuickBasic and Windows XP]]>
back in the 1980's I wrote a number of programs in QB45 which are related to my work (gas pipelines) and which I still use today as I haven't yet found anything which works better! Each program has a subroutine called GetGas which searches C:\CHPROGS for files with the extension *.GAS and sorts the names into a file which can then be read to allow a particular gas composition to be used in the rest of the program. The *.exe version of each program has run perfectly up to date in all versions of Windows up to XP.

Recently (possibly after a new XP service pack was installed, but not sure about that) each time the program gets to GetGas in starts looking for the stored *.GAS files the computer throws up the error message "Not enough memory to complete the sort". There is certainly plenty of memory available on the machine, so it must be something to do with the way XP is allocating resources.

Any ideas, anyone? The relevant section of the QB45 code seems to be

LOCATE 16, 15: INPUT GasFileDir$: IF GasFileDir$ = "" THEN GasFileDir$ = DefaultDir$
FOR i = 6 TO 16 STEP 2
LOCATE i, 15: PRINT " "
NEXT i
MissHead:
'SHELL "cd " + GasFileDir$
SHELL "dir " + GasFileDir$ + "\*.gas|sort>" + GasFileDir$ + "\gasfiles.dir"
OPEN GasFileDir$ + "\gasfiles.dir" FOR INPUT AS #1
j = 1
DO UNTIL EOF(1)
LINE INPUT #1, FileName$
FOR i = 1 TO 10
IF MID$(FileName$, i, 1) = " " AND MID$(FileName$, 10, 3) = "GAS" THEN
GasFile$(j) = LEFT$(FileName$, i - 1)
j = j + 1
EXIT FOR
END IF
NEXT i
LOOP
CLOSE #1
j = j - 1
FOR i = 1 TO j
OPEN GasFileDir$ + "\" + GasFile$(i) + ".GAS" FOR INPUT AS #1
INPUT #1, FileHead$(i)
CLOSE #1
NEXT i
GOSUB header
CALL Cenprint(5, "Gases on File", 4)
disp: COLOR 13
FOR i = 1 TO 10
IF i + inc > j THEN EXIT FOR
LOCATE 5 + i, 10
PRINT CHR$(i + 64) + ") " + FileHead$(i + inc)
NEXT i
GOSUB endpage
IF inc > j THEN inc = inc - 10
GOTO disp
endpage:


Mind you, it's so long since I wrote it that I'm not sure I understand what it all means any more: I just know it used to work!

Thanks
Chris

Statistics: Posted by Pipeliner — Mon Feb 18, 2013 5:47 pm


]]>