PRINT "Waiting 3 minutes for warm up..." tm = TIMER WHILE TIMER - tm < 180 IF INKEY$ <> "" THEN GOTO skip WEND skip: PRINT "3 minutes has expired..." FOR k = 1 TO 4 FOR j = 1 TO 4 SOUND 2000, 1 FOR i = 1 TO 1000: NEXT i NEXT j FOR i = 1 TO 2000: NEXT i NEXT k PRINT "Remove RF jumper then..." PRINT "Set LM723 output to 5.000V...": GOSUB 1000 PRINT "Set ADC reference voltage to 1.0900V...": GOSUB 1000 PRINT "Set RF voltage to -2.150 (this depends on probe)...": GOSUB 1000 PRINT "-> replace rf jumper" PRINT "ADC test: use hands to make diode voltage change..." PRINT "--> hit key when through" PRINT "Diode", "T0", "T1", "T2", "Zero" GOSUB 2000 PRINT "Testing Balance Relay..." PRINT " Does it BUZZZZ?????" PRINT "--> hit a key when ready to continue" WHILE INKEY$ <> "": WEND WHILE INKEY$ = "" PRINT #1, "89"; WEND PRINT "Waiting for buffer to empty..." PRINT #1, "I"; INPUT #1, a$ PRINT #1, "D"; PRINT "DAC test in progress": GOSUB 1000 klup: PRINT "Keyboard test: hit 0 1 2 3 4 5 6 7 8 9 MODE PRINT and GO keys" PRINT #1, "G" PRINT #1, "H"; INPUT #1, a$ IF a$ = "0123456789-." THEN PRINT "Keyboard OK": GOTO kok SOUND 440, 2 PRINT "Keyboard test failed-- retry(Y/N)?" klup2: a$ = INKEY$ IF a$ = "Y" THEN GOTO klup IF a$ = "y" THEN GOTO klup IF a$ = "n" THEN GOTO kok IF a$ = "N" THEN GOTO kok GOTO klup2 kok: PRINT "Testing Aux Module..." OPEN "i", #2, "c:\sb900\auxlog" PRINT #1, "ADFBFB"; WHILE NOT EOF(2) INPUT #2, b$ tm = TIMER WHILE (TIMER - tm < 3) AND (LOC(1) < 1): WEND IF LOC(1) > 0 THEN INPUT #1, a$ IF a$ <> b$ THEN GOTO mbad WEND t = 3: GOSUB 3000 IF LOC(1) > 0 THEN PRINT "Too Many entries": GOTO mbad GOTO mok mbad: PRINT "############## Error in reading Aux Module!!!" SOUND 880, 2 mok: PRINT "Aux Module test complete" PRINT "Serial port handshaking check" PRINT #1, "ADFBFB"; CLOSE PRINT "-> Listing on LCD be 'frozen'" PRINT "-> Unplug Aux Module" PRINT "-> Unplug serial port and listing should finish" PRINT PRINT "-> Finish by doing the 'twist test'" PRINT PRINT "?? test another?? (Y/N)??" dlup: a$ = INKEY$ IF a$ = "Y" THEN GOTO tlup IF a$ = "y" THEN GOTO tlup IF a$ = "n" THEN GOTO done IF a$ = "N" THEN GOTO done GOTO dlup done: END 1000 PRINT "--> Hit a key when ready to continue..." WHILE INKEY$ <> "": WEND WHILE INKEY$ = "": WEND RETURN 2000 REM monitor diode voltage WHILE INKEY$ <> "": WEND posn = CSRLIN PRINT #1, "R0"; WHILE INKEY$ = "" PRINT #1, "R0"; INPUT #1, v0 PRINT #1, "BR1"; INPUT #1, v1 PRINT #1, "BR2"; INPUT #1, v2 PRINT #1, "BR3"; INPUT #1, v3 PRINT #1, "BR4"; INPUT #1, v4 PRINT #1, "B"; IF v0 > 50000 THEN v0 = v0 - 100000 IF v1 > 50000 THEN v1 = v1 - 100000 IF v2 > 50000 THEN v2 = v2 - 100000 IF v3 > 50000 THEN v3 = v3 - 100000 IF v4 > 50000 THEN v4 = v4 - 100000
Title: Re: Need Help converting program from old qbasic to qb64
Post by: steinguy on March 07, 2021, 01:53:03 pm
thanks
Title: Re: Need Help converting program from old qbasic to qb64
Post by: Richard Frost on March 07, 2021, 08:39:56 pm
Appears that it should work as is, but it may overheat your CPU.
Loops that have no input (INKEY$ doesn't count) should contain a _LIMIT. Using FOR/NEXT as a delay will be so fast as to be useless - use _DELAY.
Title: Re: Need Help converting program from old qbasic to qb64
Post by: steinguy on March 07, 2021, 09:22:15 pm
Richard frost Not much of a programmer to be honest. The error I'm getting is bad file mode at print# 1, ,"d1973....." line. Its essentially not send that string to machine via serial port.
Title: Re: Need Help converting program from old qbasic to qb64
Post by: Richard Frost on March 07, 2021, 10:05:51 pm
I looked for code I used long ago. There are optional but sometimes necessary parameters for a serial port. Like:
OPEN "COM1:1200,n,8,1,CD,CS,DS,RS,RB4096" for random as #1
And rather than relying on handshaking to take care of it for you, don't be sending so much data at once.
Title: Re: Need Help converting program from old qbasic to qb64
Post by: MWheatley on March 10, 2021, 05:41:01 am
Program runs fine under QuickBasic 4.5 in 64-bit Windows 10, and QuickBasic 4.5 is what it looks like it was written in.
When I say "runs fine", I mean that it gets past the line in question OK, and prints to my laser printer.
Obviously, I don't possess whatever the device is, and so can't check that aspect of things.
Malcolm
Title: Re: Need Help converting program from old qbasic to qb64
Post by: moises1953 on March 18, 2021, 04:06:52 am
The serial ports must be used using put and get, char by char, so you must create your own line function, like this to substitute the print command
Title: Re: Need Help converting program from old qbasic to qb64
Post by: steinguy on March 18, 2021, 11:51:17 am
@MWheatley , Can you possibly point me to a useable download link, I tried two different ones and Im getting an uncompatible error.
Thanks,
Steinguy
Title: Re: Need Help converting program from old qbasic to qb64
Post by: MWheatley on March 18, 2021, 01:50:53 pm
I think you're asking for a link for QuickBasic 4.5? You'll also need vDosPlus to run it under.
My recommendation would be prove to yourself it works, and then port it to QB64 using the advice in this thread. Much simpler than using DOS-era code under a DOS emulator!
I bought my copy of QuickBasic 4.5 back in 1989, but you'll probably find it on an abandonware site -- I'd try Vetusware first.
You can get vDosPlus here: http://vdosplus.org/ (http://vdosplus.org/) That said, I'd click through to the link to Ed Mendelson's download page, and download it from there.
Malcolm
Title: Re: Need Help converting program from old qbasic to qb64
Post by: Bert22306 on March 18, 2021, 04:21:25 pm
Before stumbling onto QB64, I was using QB v7.1, which I got from this site:
As you can see, there are also an English and a German version of QB v4.5 available there. I used to run v7.1 over DOSbox, over Windows 7.
https://www.dosbox.com/download.php?main=1
There was a speed hit, but that aside, it worked fine. Also, you could get fonts for DOSbox, to expand the window of the QB IDE to more lines than the old, small default.