QBasic and QB64 Discussion Board

[QB Forum Archives (1999-2009)/ ] [QB FAQ] [QB Links and Downloads] [Subforums and Chat Room] [Search]

QB64.Net Homepage   QB/QB64 Keywords   QB Graphics Forum   Homework Policy



I'm getting an error code 62

by Docfxit (Login Docfxit)
R

I'm getting an error code 62 on the third line down:

wsFileNum = 1
IF NOT EOF(wsFileNum) THEN ' some data available
tmp$ = INPUT$(LOC(wsFileNum), # wsFileNum) ' so read it
ELSE
tmp$ = ""
END IF


Error 62 = Input past end of file. Check for the end of file with EOF when reading from a file.

The com port is open.
Do you have any idea why?

Thank you,

Docfxit

Posted on Dec 7, 2011, 4:01 PM

Respond to this message   

Return to Index


You can't read an empty buffer

by (Login burger2227)
R


IF LOC(wsFileNum) THEN
   tmp$ = tmp$ + INPUT$(1, #wsFileNum)
END IF


I suggest you just read one byte at a time instead of the entire buffer.

Posted on Dec 7, 2011, 4:37 PM

Respond to this message   

Return to Index


* The program is locking up on this code

by DOCFXIT (Login Docfxit)
R

Posted on Dec 8, 2011, 12:50 PM

Respond to this message   

Return to Index


Then remove EOF. I was debating that.

by (Login burger2227)
R

LOC will tell when to read the buffer without worrying about EOF. EOF is not necessary but you looked like you were getting it to work:

DO
K$ = INKEY$
IF LOC(wsFileNum) THEN
tmp$ = tmp$ + INPUT$(1, #wsFileNum)
END IF
IF LEN(K$) THEN PRINT #wsFileNum, K$
LOOP UNTIL K$ = CHR$(27) 'escape key exit

If you have other things to do, put them inside the loop.

Posted on Dec 8, 2011, 4:35 PM

Respond to this message   

Return to Index


The program is still not reading the com port

by Docfxit (Login Docfxit)
R

I have added print statements to prove where the problem is.
The first print statement 4183 prints.

IF debugflag$ = "Onn1" THEN
LOCATE Ix, 1: PRINT "Line 4183 Ix = "; Ix; " wsFileNum = "; wsFileNum;
Ix = Ix + 1
END IF
DO
K$ = INKEY$
IF LOC(wsFileNum) THEN
tmp$ = tmp$ + INPUT$(1, # wsFileNum)
IF debugflag$ = "Onn1" THEN
LOCATE Ix, 1: PRINT "Line 4206 Ix = "; Ix; " wsFileNum = "; wsFileNum; "tmp$ = "; tmp$
Ix = Ix + 1
END IF
END IF
IF LEN(K$) THEN PRINT #wsFileNum, K$
LOOP UNTIL K$ = CHR$(27) 'escape key exit

IF debugflag$ = "Onn1" THEN
LOCATE Ix, 1: PRINT "Line 4214 Ix = "; Ix; " tmp$ = "; tmp$;
Ix = Ix + 1
END IF

I do have another program identical to this one (except for the changes made for qb64) that runs with QB 7.1 on this same PC.

I moved the print debug statements around. I put one before:
IF LOC(wsFileNum) THEN
and one after. The one before shows wsFileNum = 1
I found the program is not locking up. It's in the Do loop. The:
IF LOC(wsFileNum) THEN
It's skipping the If statement.

Any ideas how I could get this to run?

Thanks,

Docfxit

Posted on Dec 9, 2011, 11:26 AM

Respond to this message   

Return to Index


If there is nothing in buffer, it should skip it

by (Login burger2227)
R

What are you trying to read. What are you sending TO the port?

When the buffer holds data, LOC returns the number of bytes. Any value over 0 will execute the IF statement. Otherwise nothing will print.

If you are using QB64 post problems there. I have NO IDEA how QB64 works with COM ports. Ask Galleon because there have been numerous problems!

http://www.qb64.net/forum/index.php?topic=839.0

Posted on Dec 9, 2011, 12:16 PM

Respond to this message   

Return to Index


"Cannot convert number to string"

by Docfxit (Login Docfxit)
R

I'm getting an error with this combination during compile.

"Cannot convert number to string" on the if statement.

DIM debugflag AS STRING

debugflag = "Onn"

IF debugflag = "Onn"

What is the proper syntax?

Thanks,

Docfxit

Posted on Dec 7, 2011, 1:40 PM

Respond to this message   

Return to Index


IF can only use a numerical value that way.

by (Login burger2227)
R

IF number THEN will work when the number is not 0

IF LEN(text$) THEN will work when the string length is not 0

IF text$ THEN is a no no

IF text$ = " " THEN will work if text$ is a space character

Posted on Dec 7, 2011, 2:11 PM

Respond to this message   

Return to Index


If that's the case this should work?

by Docfxit (Login Docfxit)
R

If that's the case this should work.

DIM debugflag$

debugflag$ = "Onn"

IF debugflag$ = "Onn"

But it doesn't. Why?

Thanks,

Docfxit

Posted on Dec 7, 2011, 2:25 PM

Respond to this message   

Return to Index


* THEN what?...

by (Login burger2227)
R

Posted on Dec 7, 2011, 2:43 PM

Respond to this message   

Return to Index


I figured it out

by Docfxit (Login Docfxit)
R

I figured it out. It wasn't working because I didn't have shared in the DIM

DIM shared debugflag$

debugflag$ = "Onn"

IF debugflag$ = "Onn" Then

PRINT "debugflag$ = "; debugflag$

End If

It should print Onn. Now it does.

Thanks,

Docfxit

Posted on Dec 7, 2011, 2:52 PM

Respond to this message   

Return to Index


* It didn't need SHARED because it isn't in a SUB. Worked 4 me

by (Login burger2227)
R

Posted on Dec 7, 2011, 3:31 PM

Respond to this message   

Return to Index


Convert number to a string

by Theunis (no login)

Your snippet is too short to comment on. What are you doing after then ....
To convert a number to a string use - A$ = Str$(123) ' or whatever number it is. If a numerical variable is named say Z it would be A$ = Str$(Z).
If you have QB4.5 check out the HELP. There are examples for all the commands/Functions/reserved words.

IF DebugFlag = "Onn" then
.......
END IF

Posted on Dec 28, 2011, 5:04 AM

Respond to this message   

Return to Index


Re: Convert number to a string

by Theunis (no login)

Sorry I forgot to add. Since you have defined DebugFlag as a string you can compare it with any other string. IF DebugFlag = "Nno" is thus a valid comparison.

So give us more information on what you are trying to do, please

Posted on Dec 28, 2011, 5:35 AM

Respond to this message   

Return to Index


PLAY function problems

by (no login)

I have a program that I wrote some years ago using Qbasic version 1.1 which among other things uses PLAY to play musical notes. This worked fine on my old Win95 PC. I copied Qbasic and the program on to my current WinXP machine and the program ran OK except that it did not produce any sound. Is this because my current PC has "external" speakers and no internal speaker? If so is there a way around this please?
I do not think that it is a problem with my coding because I have also tried running the examples given in the Qbasic help file and these do not produce any sound either.
Incidentally my interest in this old program was rekindled as I am now thinking of changing to a iMac and searching the internet to see what software was available for a iMac I came across references to QB64. Am I likely to have a similar problem with the iMac machine?
Apologies if this question reveals my hopeless lack of knowledge but any help will be appreciated. Thanks.

Posted on Dec 6, 2011, 11:14 AM

Respond to this message   

Return to Index


QB64 uses your stereo speakers to produce all sounds!

by (Login burger2227)
R

Qbasic required an internal speaker.

Posted on Dec 6, 2011, 11:56 AM

Respond to this message   

Return to Index


* thanks for confirming my thoughts

by (no login)

Posted on Dec 7, 2011, 7:55 AM

Respond to this message   

Return to Index


*Do yourself a favor and download QB64, you won't regret it!

by Galleon (no login)

Posted on Dec 7, 2011, 12:38 AM

Respond to this message   

Return to Index


* will do when I get a mac.

by (no login)

Posted on Dec 7, 2011, 7:56 AM

Respond to this message   

Return to Index


* Do it now in Windows. It works great with sound!

by (Login burger2227)
R

Posted on Dec 7, 2011, 8:55 AM

Respond to this message   

Return to Index


* tonyf: Always add an asterisk to the title when there is no inside message.

by Solitaire (Login Solitaire1)
S

Posted on Dec 7, 2011, 1:27 PM

Respond to this message   

Return to Index


QUIZ program

by Dr. Juice (no login)

CONST FRANCAIS = 1
CONST ANGLAIS = 2
CONST NUMWORDS=8
DIM X(1 TO NUMWORDS, 1 TO 2) AS STRING
FOR I = 1 TO NUMWORDS
READ X(I,1), X(I,2)
NEXT
PRINT "Tutor for the Language of Voltaire"
PRINT "Note: include the definite article"
DO
i = INT(RND(1)*NUMWORDS)+1
? "What is the French word for "; x(i,ANGLAIS)
LINE INPUT z$
z$ = LTRIM$(RTRIM$(LCASE$(Z$)))
if z$ = x(i,FRANCAIS) then PRINT "Correct" else PRINT "No, it's "; x(i,FRANCAIS)
LOOP

DATA le chien, dog
DATA le cygne, swan
DATA le phoque, seal
DATA la grenouille, frog
DATA le coq, rooster
DATA le âne, donkey
DATA le singe, ape
DATA le chat, cat

Posted on Dec 4, 2011, 2:56 PM

Respond to this message   

Return to Index


Works well...

by (Login qb432l)
R

It would be nice to have an exit option, since otherwise you just keep looping forever. For example, LOOP WHILE LEN(z$). In other words, if the user just presses Enter, rather than a word, the program terminates. Naturally, "Just press Enter to quit" would be printed at the top of the program.

There is also the problem of French accents, for example in "le âne". If a user doesn't have a French keyboard, and doesn't know to press Alt+131 for that character, it will be judged incorrect.

Anyway, it's a nice little quiz, and I learned something about French words. Thanks.

-Bob

Posted on Dec 4, 2011, 5:44 PM

Respond to this message   

Return to Index


haha it says a** and c***

by george (no login)

At least it was in context.  Nevertheless, post was edited to revise names of said animals to "donkey" and "rooster."

Posted on Dec 4, 2011, 10:42 PM

Respond to this message   

Return to Index


* Who is to say that you did not post that George?...

by (Login burger2227)
R

Posted on Dec 5, 2011, 9:10 AM

Respond to this message   

Return to Index


I can't get COM1 to open

by Docfxit (Login Docfxit)
R

I can't seem to get COM1 to open. Something is wrong in my logic.

DEFINT A-Z ' all ints unless otherwise specified
DIM debugflag AS STRING
DIM SHARED ComPortOpen AS STRING

debugflag$ = "Onn" 'For debugging either on or offf
comPort$ = "COM1:"
CONST comMode$ = "9600,N,8,1,CS6000,DS6000" ' change baud here if you change s12 setting
Ix = 5
Ix = Ix + 1
DO
IF wsFileNum = 0 THEN ' don't open if already open
wsFileNum = FREEFILE ' get an unused file number

'now open the serial port
ComPortOpen$ = "Yes"
IF debugflag = Onn THEN

COLOR 6: LOCATE Ix, 1: PRINT "ComPort b4 = "; comPort$; " comMode = "; comMode$; " wsFileNum = "; wsFileNum ' for debugging only
Ix = Ix + 1
IF Ix = 12 THEN
END
END IF
END IF
OPEN comPort$ + comMode$ FOR RANDOM AS wsFileNum
IF debugflag = Onn THEN
LOCATE Ix, 1: PRINT "After ComPort = "; comPort$; "PortNum = "; portNum; "wsFileNum = "; wsFileNum; "ComPortOpen "; ComPortOpen$ ' for debugging only
Ix = Ix + 1
END IF
IF wsFileNum = 0 THEN
COLOR 18: LOCATE 1, 1: PRINT "The weather station is not communicating to this PC com port"
ELSE
EXIT DO ' If the com port is open exit out of this do loop
END IF
flushWSdata
END IF
IF debugflag = Onn THEN
COLOR 7: LOCATE Ix, 1: PRINT "Is Com Port Open = "; comPort$; "PortNum = "; portNum; "wsFileNum = "; wsFileNum; "ComPortOpen "; ComPortOpen$ ' for debugging only
Ix = Ix + 1
IF Ix > 16 THEN
END
END IF
END IF

LOOP 'This will continually loop until the com port is open

The output of the debug lines is:
[linked image]

Posted on Dec 2, 2011, 8:43 PM

Respond to this message   

Return to Index


* IF debugflag = ONN needs to be a string case sensitive.

by (Login burger2227)
R

Posted on Dec 2, 2011, 9:40 PM

Respond to this message   

Return to Index


* what else do I need besides DIM debugflag AS STRING

by (Login Docfxit)
R

Posted on Dec 2, 2011, 9:47 PM

Respond to this message   

Return to Index


"Onn" and what does flushWSdata do?

by (Login burger2227)
R

What is the idea of printing FREEFILE? It will always be 2 because 1 is taken. The FREEFILE value will not tell you if the port was opened.

COM ports need something on them to do anything. All registers read 255 otherwise.

Posted on Dec 2, 2011, 10:09 PM

Respond to this message   

Return to Index


Re: "Onn" and what does flushWSdata do?

by Docfxit (Login Docfxit)
R

I see that I set the value of debugfile to Onn and on the if statements I had ONN. It was working but I changed it anyway so they are all the same.

SUB flushWSdata
'** clear any previous data from the station, both from serial port buffer
'** and from wsInputBuf$

wsInputBuf$ = ""

IF wsFileNum 0 THEN ' the port is open, so read any chars
WHILE LOC(wsFileNum) 'check to see if anything is in buffer
junk$ = INPUT$(LOC(wsFileNum), # wsFileNum)
WEND
END IF
END SUB

Now can you see why the com port doesn't seem to be opening?

Thanks,

Docfxit

Posted on Dec 2, 2011, 11:07 PM

Respond to this message   

Return to Index


*wow how did you get that shadow underneath the image?

by goerge (no login)

Posted on Dec 2, 2011, 11:03 PM

Respond to this message   

Return to Index


Re: wow how did you get that shadow underneath the image?

by Docfxit (Login Docfxit)
R

Are you talking about my image.

I used a print screen program that does it automatically. It's called winsnap. You can google it.

Docfxit

Posted on Dec 2, 2011, 11:15 PM

Respond to this message   

Return to Index


Re: I can't get COM1 to open

by Docfxit (Login Docfxit)
R

I added:

IF errnum = 0 THEN PRINT "COM exists!

Right after the open of the com port. And it does print.
Maybe my logic is wrong. I'm testing:
IF wsFileNum = 0

To mean the com port is closed. Maybe that is not a good test. When would the
file number be removed?

Thanks,

Docfxit

Posted on Dec 7, 2011, 10:19 AM

Respond to this message   

Return to Index


That's what I was trying to tell you.

by (Login burger2227)
R

The FREEFILE number assigned does not change whether a file or port opens or not!

The only way to test it is to use it. There must be something connected to COM 1 port to use it and read or write to it.

Posted on Dec 7, 2011, 10:52 AM

Respond to this message   

Return to Index


Re: That's what I was trying to tell you.

by Docfxit (Login Docfxit)
R

I think I understand what you are saying now.
What through me off is this code has been in this program for years.

IF wsFileNum = 0 THEN ' don't open if already open
wsFileNum = FREEFILE ' get an unused file number

What you are telling me is this code will have wsFileNum = 0 all the time.
Whether the com port is open or not.

Is there a way to read the com port without throwing the next read off?

An other words if I read the com port and it comes back with xyz, will the next
read still come back with xyz?

I'm just looking for a way to test the com port.

Thanks,


Docfxit

Posted on Dec 7, 2011, 11:25 AM

Respond to this message   

Return to Index


No, the variable will have whatever FREEFILE gives it. Not 0 ever!

by (Login burger2227)
R

Here is how you can find them if they exist in Windows 98:

SUB FindCOM
DEF SEG = 0
C1% = PEEK(&H411)
numCom% = INT(C1% / 2) - INT(C1% / 16) * 8
COLOR 11: LOCATE , 30: PRINT " Number of COM ports ="; numCom%
FOR i% = 1 TO numCom%
ser% = PEEK(&H400 + (i% - 1) * 2) + PEEK(&H400 + (i% - 1) * 2 + 1) * 256
COLOR 14: LOCATE , 30: PRINT "COM"; HEX$(i%);
IF ser% = 0 THEN
PRINT " not found"
ELSE PRINT " found at &H"; HEX$(ser%); " ("; LTRIM$(STR$(ser%)); ")"
END IF
NEXT i%
DEF SEG
END SUB

XP will return all of them because NTVDM blocks all port access from DOS. You can use PORT TALK to access them but Again, you cannot access a COM port without anything on it! The only way to find that it exists is to use it. COM 1 should be on most computers.

Posted on Dec 7, 2011, 12:03 PM

Respond to this message   

Return to Index


* clippy how do you get 5V out of two 1,5 volt battaries (3V) ?

by Docfxit (no login)

Posted on Dec 9, 2011, 8:33 AM

Respond to this message   

Return to Index


* I don't

by Clippy (no login)

Posted on Dec 9, 2011, 9:25 AM

Respond to this message   

Return to Index


Need help with context menu program

by (no login)

the program is supposed to pull up a context menu when your right click. Then, when choose one of the options (there is only one right now) it executes some action.

The option that i have on the context menu right now is color choose. However, when i click on it, nothing happens.

Source Code:


hdscreen = _NEWIMAGE(1920, 1080, 32)'Change resolution based on screen
SCREEN hdscreen
DIM colorchoose%(100000)
PRINT "Choose Color"
GET (0, 0)-(150, 25), colorchoose%()
CLS
r = 30
g = 40
b = 180


DO

_LIMIT 60
LINE (0, 0)-(1920, 1080), _RGB(r, g, b), BF' change based on screen
firstc = -1
DO WHILE _MOUSEINPUT
left = _MOUSEBUTTON(1) * -1
right = _MOUSEBUTTON(2) * -1
middle = _MOUSEBUTTON(3) * -1
scroll = _MOUSEWHEEL * -1
curpx = _MOUSEX
curpy = _MOUSEY
curpxr = CINT(_MOUSEX)
curpyc = CINT(_MOUSEY)
LOOP
IF right = 1 THEN
firstc = firstc * -1
switch = 0
cm = 1
END IF
IF left <> 1 AND cm = 1 THEN
GOSUB contextmenu

END IF
IF left = 1 AND (_MOUSEX > tempx OR _MOUSEX > (tempx + 150) OR _MOUSEY < tempy OR _MOUSEY > tempy + 30) THEN
cm = 0
switch = 0
END IF

_DISPLAY
LOOP







contextmenu:

IF switch = 0 THEN
tempx = curpx
tempy = curpy
tempr = curpxr
tempc = curpyc
IF curpy > 780 THEN tempy = tempy - (curpy - 780)' change based on screen (should be screen height - 300)

IF curpx > 1770 THEN tempx = tempx - (curpx - 1770)' change based on screen (should be screen height - 150)
END IF
LINE (tempx, tempy)-(tempx + 150, tempy + 300), _RGB(200, 200, 200), BF
LINE (tempx, tempy + 30)-(tempx + 150, tempy + 30), _RGB(0, 0, 0)


PUT (tempx + 2, tempy + 2), colorchoose%()

IF _MOUSEX >= tempx AND _MOUSEX <= (tempx + 150) AND _MOUSEY >= tempy AND _MOUSEY <= tempy + 30 AND left = 1 THEN
BEEP
LOCATE 310, 235
PRINT "Use the mouse wheel to change color."
r = r + scroll * 15
b = b + scroll * 10
g = g + scroll * 5
IF r > 255 THEN r = 0
IF b > 255 THEN b = 0
IF g > 255 THEN g = 0
IF r < 0 THEN r = 255
IF b < 0 THEN b = 255
IF g < 0 THEN g = 255
END IF




switch = 1








RETURN

Posted on Dec 2, 2011, 6:58 PM

Respond to this message   

Return to Index


context menu

by goerge (no login)

its a good menu, one i personally am planning to use in the future



SCREEN _NEWIMAGE(640, 480, 32)

DIM menu(7) AS STRING
DIM million(10000000) AS INTEGER

menu(0) = "zero"
menu(1) = "one"
menu(2) = "two"
menu(3) = "three"
menu(4) = "four"
menu(5) = "five"
menu(6) = "----------"
menu(7) = "exit"
renamed = LEN(menu(0))
FOR i = 0 TO UBOUND(menu)
IF LEN(menu(i)) > ten THEN ten = LEN(menu(i))
NEXT
x1 = ten * 8
y1 = (UBOUND(menu) + 1) * 16
m = -1
'80x30,8x16
DO
1
DO
LOOP WHILE _MOUSEINPUT


IF _MOUSEBUTTON(2) THEN
m = -1
x = (_MOUSEX \ 8) * 8
y = (_MOUSEY \ 16) * 16
IF (x + x1) > 640 THEN x = 640 - x1
GET (x - 1, y - 1)-STEP(x1 + 1, y1 + 1), million(0)

LINE (x - 1, y - 1)-STEP(x1 + 1, y1 + 1), _RGB(255, 255, 255), B
DO
DO
LOOP WHILE _MOUSEINPUT
IF _MOUSEX < x OR _MOUSEX > (x + x1) THEN EXIT DO
IF _MOUSEY < y OR _MOUSEY > (y + y1) THEN EXIT DO
FOR i = 0 TO UBOUND(menu)
COLOR _RGB(0, 0, 0), _RGB(255, 255, 255)
IF ((_MOUSEY - y) \ 16) = i THEN COLOR _RGB(0, 0, 0), _RGB(255, 0, 0)
IF ((y \ 16) + 1 + i) <= 30 THEN
LOCATE (y \ 16) + 1 + i, (x \ 8) + 1
PRINT menu(i) + SPACE$(ten - LEN(menu(i)));
END IF
NEXT
_DISPLAY
IF _MOUSEBUTTON(1) THEN
m = ((_MOUSEY - y) \ 16)
EXIT DO
END IF
LOOP
PUT (x - 1, y - 1), million(0), _CLIP PSET
_DISPLAY

END IF

COLOR _RGB(255, 255, 255), _RGB(0, 0, 0)
SELECT CASE m
CASE -1
LOCATE 1, 1: PRINT "nothing selected"
CASE 6
CASE 7
SYSTEM
CASE ELSE
LOCATE 1, 1: PRINT "selected item #"; m; ": "; menu(m)
END SELECT
_DISPLAY


LOOP
SLEEP
SYSTEM



========================================================================

Above code was edited by Solitaire to remove foul language used as variable names.  Names were replaced with number words.

----------------

edited by mcalkins to clean up one remaining word.

Posted on Dec 2, 2011, 10:59 PM

Respond to this message   

Return to Index


Re: context menu

by (no login)

So what exactly is wrong with mine?

Wonderful vocabulary you have there by the way.

Posted on Dec 3, 2011, 6:16 AM

Respond to this message   

Return to Index


nothing

by george (no login)

it's just an example to calculate selection/coordinates/drawings etc from mouse coordinates. also calculates height/length based on the array and string sizes.

Posted on Dec 3, 2011, 8:25 AM

Respond to this message   

Return to Index


Re: context menu

by george (no login)

I'm not sure if you're being a **** or what, but in my program I was recommending a completely diffrent logic approach to makign menus. It was more flexible and easier to work with opposed to if statements checkign position selection. the action of each selection can be fairly easily added to the block select case statement.

As far your porgram, I noticed you had some errorneus mouse coordinate comparisions and I made some modificatedtions which fix it and stop WHEN YOU SELECT COLOR CHOOSE and SLEEP for the time writing a message. Those switch and cm flags i noticed are not a good approach I believe. I could further experiment with )MOUSEWHEEL but qb64 on my system doesnt recoginze the mouse wheel.

Anyways, it sucks you're taking away my potiec license and disallowing me to use my own varaiable names, but I modiefied ur porogram as stasted above and here it is. I'd be glad to help becauyse i like menus and i made them before.



hdscreen = _NEWIMAGE(1920, 1080, 32) 'Change resolution based on screen
SCREEN hdscreen
DIM colorchoose%(100000)
PRINT "Choose Color"
GET (0, 0)-(150, 25), colorchoose%()
CLS
r = 30
g = 40
b = 180


DO

    _LIMIT 60
    LINE (0, 0)-(1920, 1080), _RGB(r, g, b), BF ' change based on screen
    firstc = -1
    DO WHILE _MOUSEINPUT
        left = _MOUSEBUTTON(1) * -1
        right = _MOUSEBUTTON(2) * -1
        middle = _MOUSEBUTTON(3) * -1
        scroll = _MOUSEWHEEL * -1
        curpx = _MOUSEX
        curpy = _MOUSEY
        curpxr = CINT(_MOUSEX)
        curpyc = CINT(_MOUSEY)
    LOOP
    IF right = 1 THEN
        firstc = firstc * -1
        switch = 0
        cm = 1
    END IF
    IF left <> 1 AND cm = 1 THEN
        GOSUB contextmenu

    END IF
    IF left = 1 THEN
        IF (_MOUSEX > tempx AND _MOUSEX < (tempx + 150) AND _MOUSEY > tempy AND _MOUSEY < tempy + 30) THEN
            LOCATE 1, 1: PRINT "item 1 selected,press any key to continue"
            _DISPLAY
            SLEEP
            cm = 0
            switch = 0
        ELSE
            cm = 0
            switch = 0
        END IF
    END IF
    _DISPLAY
LOOP







contextmenu:

IF switch = 0 THEN
    tempx = curpx
    tempy = curpy
    tempr = curpxr
    tempc = curpyc
    IF curpy > 780 THEN tempy = tempy - (curpy - 780) ' change based on screen (should be screen height - 300)

    IF curpx > 1770 THEN tempx = tempx - (curpx - 1770) ' change based on screen (should be screen height - 150)
END IF
LINE (tempx, tempy)-(tempx + 150, tempy + 300), _RGB(200, 200, 200), BF
LINE (tempx, tempy + 30)-(tempx + 150, tempy + 30), _RGB(0, 0, 0)


PUT (tempx + 2, tempy + 2), colorchoose%()


IF _MOUSEX >= tempx AND _MOUSEX <= (tempx + 150) AND _MOUSEY >= tempy AND _MOUSEY <= tempy + 30 AND left = 1 THEN
    BEEP
    LOCATE 1, 1
    PRINT "Use the mouse wheel to change color."
    r = r + scroll * 15
    b = b + scroll * 10
    g = g + scroll * 5
    IF r > 255 THEN r = 0
    IF b > 255 THEN b = 0
    IF g > 255 THEN g = 0
    IF r < 0 THEN r = 255
    IF b < 0 THEN b = 255
    IF g < 0 THEN g = 255
    RETURN
END IF




switch = 1








RETURN

Posted on Dec 3, 2011, 4:27 PM

Respond to this message   

Return to Index


george, your contributions are appreciated.

by (Login MCalkins)
Moderator

Anyone who comes to these forums and helps out other programmers is commendable.

As far as vocabulary goes, you have a 1st amendment (U.S. Constitution) right to say almost anything without governmental interference. But we also have the right to make and enforce rules for this privately owned forum. Just because you have a right doesn't mean that there aren't consequences for exercising it.

I am sure that you can express yourself adequately without the entire vocabulary of the English language.

Regards,
Michael

Posted on Dec 3, 2011, 5:28 PM

Respond to this message   

Return to Index


* Please remove above post for language issues!

by (Login burger2227)
R

Posted on Dec 3, 2011, 6:29 AM

Respond to this message   

Return to Index


Post was edited to remove foul language. Warning to george:

by Solitaire (Login Solitaire1)
S

Foul language is not permitted on this forum.  Next time your entire post will be deleted.  Repeated offenses may result in your being banned.

Please be a good forum member.  Thanks for your cooperation.

 

Posted on Dec 3, 2011, 9:36 AM

Respond to this message   

Return to Index


Locate illegal function call, help

by (no login)

Hello guys

When I try a simple code like:

CLS
LOCATE 40, 1: print "hello"

It gives me a illegal function call error when I run it. I understand that the problem is on the number 40, but, what if I want to display a lot of information on multiple lines the exceed the number of 40? is it impossible on Qbasic? (Having a scroll bar would be awesome u.u for example)

thanks

Posted on Dec 2, 2011, 6:11 PM

Respond to this message   

Return to Index


SCREEN 0 can have 43 or 50 rows with WIDTH

by (Login burger2227)
R

SCREEN 12 can have 30 or 60 rows with WIDTH 80, 60

Don't use locate to scroll the screen, just use consecutive PRINTS without LOCATE. LOCATE can NOT be 0 either.

Posted on Dec 2, 2011, 6:22 PM

Respond to this message   

Return to Index


Multiple Screen Displays

by Solitaire (no login)

The normal screen length is 24 without scrolling. If you want to display more than 24 lines, I would add a pause for the user to read what's on the screen before continuing.

Here is a simple example:

DIM x AS INTEGER
CLS
FOR x = 1 TO 23
PRINT "This is line # "; x
NEXT x
PRINT "Press any key to continue..."; INPUT$(1)
FOR x = 24 TO 46
PRINT "This is line # "; x
NEXT x
END

==============================================================
The following example is more elaborate:

DIM snum AS STRING, num AS INTEGER, x AS INTEGER, lin AS INTEGER, dis AS INTEGER
lin = 0
CLS
INPUT "How many screens to display:  ", snum$
num = VAL(snum$)
If num = 0 THEN num = 1
FOR display = 1 TO num
    dis = 0
    DO
        dis = dis + 1
        lin = lin + 1
        PRINT "This is line # "; lin
    LOOP UNTIL dis = 23
    IF display [ num THEN
        PRINT "Press any key to continue..."; INPUT$(1)
    END IF
NEXT display
END


Note: The less than symbol does not display on this forum. Please substitute the less-than symbol for the [ on this line:

IF display [ num THEN

Posted on Dec 3, 2011, 9:13 AM

Respond to this message   

Return to Index


Re: Multiple Screen Displays

by (Login MCalkins)
Moderator

You can use all 25 lines. The default view port is lines 1 to 24, but you can still print to line 25. If you use VIEW PRINT, you can set the view port to all the lines.

Regards,
Michael

Posted on Dec 4, 2011, 8:03 PM

Respond to this message   

Return to Index


Thank you, Michael. Revised Multiple Screen Displays with more options:

by Solitaire (Login Solitaire1)
S

The following will display all 25 lines in each screen.  User has option to enter number of screens to display.  User may then press any key to continue display to the next screen. 

Second listing adds option for user to press Esc to stop after any screen. 

===================================================================================

DIM snum AS STRING, num AS INTEGER, display AS INTEGER
DIM lin AS INTEGER, dis AS INTEGER
CLS
INPUT "How many screens to display:  ", snum$
num = VAL(snum$)
PRINT : PRINT
PRINT "Press any key to continue to next screen until you get to line";
PRINT num * 25; "...."; INPUT$(1)
CLS
VIEW PRINT 1 TO 25
lin = 0
FOR display = 1 TO num
    dis = 0
    DO
        dis = dis + 1
        lin = lin + 1
        IF dis = 25 THEN
            PRINT "This is line # "; lin; INPUT$(1)
        ELSE
            PRINT "This is line # "; lin
        END IF
    LOOP UNTIL dis = 25
NEXT display
VIEW PRINT
CLS
SYSTEM

==========================================================================

DIM snum AS STRING, num AS INTEGER, display AS INTEGER
DIM lin AS INTEGER, dis AS INTEGER
CLS
INPUT "How many screens to display:  ", snum$
num = VAL(snum$)
PRINT : PRINT
PRINT "Press any key to continue to next screen up to line";
PRINT num * 25; "or Esc to stop...."; INPUT$(1)
CLS
VIEW PRINT 1 TO 25
lin = 0
FOR display = 1 TO num
    dis = 0
    DO
        dis = dis + 1
        lin = lin + 1
        IF dis = 25 THEN
            PRINT "This is line # "; lin;
            IF INPUT$(1) = CHR$(27) THEN
                EXIT FOR
            ELSE
                LOCATE 25, 1
            END IF
        ELSE
            PRINT "This is line # "; lin
        END IF
    LOOP UNTIL dis = 25
NEXT display
VIEW PRINT
SYSTEM


 

Posted on Dec 6, 2011, 9:53 AM

Respond to this message   

Return to Index


hey look at this u can use more lines n stuff

by goerge (no login)

use arrow keys to scroll through the text which can be larger then 25 coloums


DEFINT A-Z
DECLARE SUB vprint (text$)
DECLARE SUB vcolor (f, b)
DECLARE SUB vlocate (y, x)

DIM SHARED vx, vy, vc
vx = 0
vy = 0
vc = 7

SCREEN 0
CLS

vprint "The VGA hardware has the ability treat the display as a window which can pan and"
vprint "/or scroll across an image larger than the screen, which is used by some windowi"
vprint "ng systems to provide a virtual scrolling desktop, and by some games and assembl"
vprint "y demos to provide scrolling. Some image viewers use this to allow viewing of im"
vprint "ages larger than the screen. This capability is not limited to graphics mode; so"
vprint "me terminal programs use this capability to provide a scroll-back buffer, and so"
vprint "me editors use tare you reading this shit?vide an editing screen wider than 80 c"
vprint "olumns. This feature can be implemented by brute force by simply copying the por"
vprint "tion of the image to be displayed to the screen. Doing this, however takes signi"
vprint "ficant processor horsepower. For example, scrolling a 256 color 320x200 display "
vprint "at 30 frames per second by brute force requires a data transfer rate of 1.92 meg"
vprint "abytes/second. However, using the hardware capability of the VGA the same operat"
vprint "ion would require a data transfer rate of only 120 bytes/second. Obviously there"
vprint " is an advantage to using the VGA hardware. However, there are some limitations-"
vprint "-one being that the entire screen must scroll (or the top portion of the screen "
vprint "if split-screen mode is used.) and the other being that the maximum size of the "
vprint "virtual image is limited to the amount of video memory accessible, although it i"
vprint "s possible to redraw portions of the display memory to display larger virtual im"
vprint "ages. In text mode, windowing allows panning at the character resolution. In gra"
vprint "phics mode, windowing allows panning at 8-bit resolution and scrolling at scan-l"
vprint "ine resolution. For more precise control, see Smooth Panning and Scrolling below"
vprint ". Because the VGA BIOS and most programming environment's graphics libraries do "
vprint "not support windowing, you must modify or write your own routines to write to th"
vprint "e display for functions such as writing text or graphics. This section assumes t"
vprint "hat you have the ability to work with the custom resolutions possible when windo"
vprint "wing is used. In order to understand virtual resolutions it is necessary to unde"
vprint "rstand how the VGA's Start Address High Register, Start Address Low Register, an"
vprint "d Offset field work. Because display memory in the VGA is accessed by a 32-bit b"
vprint "us, a 16-bit address is sufficient to uniquely identify any location in the VGA'"
vprint "s 256K address space. The Start Address High Register and Start Address Low Regi"
vprint "ster provide such an address. This address is used to specify eithocation of the"
vprint " first character in text mode or the position of the first byte of pixels in gra"
vprint "phics mode. At the end of the vertical retrace, the current line start address i"
vprint "s loaded with this value. This causes one scan line of pixels or characters to b"
vprint "e output starting at this address. At the beginning of the next scan-line (or ch"
vprint "aracter row in text mode) the value of the Offset Register multiplied by the cur"
vprint "rent memory address size * 2 is added to the current line start address. The Dou"
vprint "ble-Word Addressing field and the Word/Byte field specify the current memory add"
vprint "ress size. If the value of the Double-Word Addressing field is 1, then the curre"
vprint "nt memory address size is four (double-word). Otherwise, the Word/Byte field spe"
vprint "cifies the current memory address size. If the value of the Word/Byte field is 0"
vprint " then the current memory address size is 2 (word) otherwise, the current memory "
vprint "address size is 1 (byte).Normally in graphics modes, the offset register is prog"
vprint "rammed to represent (after multiplication) the number of bytes in a scan line. T"
vprint "his means that (unless a CGA/MDA emulation mode is in effect) scan lines will be"
vprint " arranged sequentially in memory with no space in between, allowing for the most"
vprint " compact representation in display memory. However, this does not have to be the"
vprint " case--in fact, by increasing the value of the offset register we can leave ext"
vprint "ra space between lines. This is what provides for virtual widths. By programmin"
vprint "g the offset register to the value of the equation: "
vprint "y demos to provide scrolling. Some image viewers use this to allow viewing of im"
vprint "ages larger than the screen. This capability is not limited to graphics mode; so"
vprint "me terminal programs use this capability to provide a scroll-back buffer, and so"
vprint "me editors use tare you reading this shit?vide an editing screen wider than 80 c"
vprint "olumns. This feature can be implemented by brute force by simply copying the por"
vprint "tion of the image to be displayed to the screen. Doing this, however takes signi"
vprint "ficant processor horsepower. For example, scrolling a 256 color 320x200 display "
vprint "at 30 frames per second by brute force requires a data transfer rate of 1.92 meg"
vprint "y demos to provide scrolling. Some image viewers use this to allow viewing of im"
vprint "ages larger than the screen. This capability is not limited to graphics mode; so"
vprint "me terminal programs use this capability to provide a scroll-back buffer, and so"
vprint "me editors use tare you reading this shit?vide an editing screen wider than 80 c"
vprint "olumns. This feature can be implemented by brute force by simply copying the por"
vprint "tion of the image to be displayed to the screen. Doing this, however takes signi"
vprint "ficant processor horsepower. For example, scrolling a 256 color 320x200 display "
vprint "at 30 frames per second by brute force requires a data transfer rate of 1.92 meg"
vcolor 12, 1
vprint "look at me hahaha"
vcolor 0, 2
vlocate 5, 5
vprint "WOW look at this haha"

s = 0
DO
DO
a$ = INKEY$
LOOP UNTIL a$ <> ""

s = s - 80 * (a$ = CHR$(0) + "P") + 80 * (a$ = CHR$(0) + "H")
IF s < 0 THEN s = 0
IF s > 14399 THEN s = 14399

OUT &H3D4, &HC
OUT &H3D5, s \ 256
OUT &H3D4, &HD
OUT &H3D5, s

LOOP UNTIL INP(&H60) = 1
SYSTEM

SUB vcolor (f, b)
vc = b * 16 + (f AND 7)
END SUB

SUB vlocate (y, x)
vx = x - 1
vy = y - 1
END SUB

SUB vprint (text$)
DEF SEG = &HB800
o& = vy * 160& + vx * 2
FOR i = 1 TO LEN(text$)
POKE o& + i + i - 2, ASC(MID$(text$, i, 1))
POKE o& + i + i - 1, vc
NEXT
vy = vy + 1
vx = 0
END SUB

Posted on Dec 4, 2011, 10:25 PM

Respond to this message   

Return to Index


Re: hey look at this u can use more lines n stuff

by geogre (no login)

u can use more tactics to make it so it can scroll sideways and up n down not char by char but pixel by pixel but i guess it depends how well ur emulates vga hardware, windows xp allows suchs features in full screen mode but not windwosed and qb64 will never support any vga stuff

Posted on Dec 4, 2011, 10:29 PM

Respond to this message   

Return to Index


QB64 runs that program fine!

by (Login burger2227)
R

QB64 doesn't NEED "VGA stuff" to do that stuff, qbasic does! QB64 already supports 32 bit screens and ALPHA!

Posted on Dec 5, 2011, 9:09 AM

Respond to this message   

Return to Index


it doesn't run it

by george (no login)

it shows the first 25 lines, but it doesn't allow scrolling with arrow keys which i what the program is demonstrating

Posted on Dec 5, 2011, 10:46 AM

Respond to this message   

Return to Index


Yeah, but perhaps that can be fixed

by (Login burger2227)
R

INP and OUT still need a lot of work. I posted it at QB64 to see if it can be fixed.

Posted on Dec 5, 2011, 12:16 PM

Respond to this message   

Return to Index


also dosbox dont clear the screen on other pages so the stuff left over might stay i notic

by george (no login)



edited by mcalkins. tried to add asterisk, but there is no room to add one.

Posted on Dec 5, 2011, 8:32 AM

Respond to this message   

Return to Index


Much room for improvements

by Peter D (no login)

I have copied all QB64 program files to C:\Program Files\QB64 (Windows 7).

I typed in a few statements, save it (just with "untitled.bas"), no error message.

Then I try to run it. "Out of memory". There are only a few "PRINT" statements and INPUT statements, so it is NOT related with the source itself.
Instead, I suspect that it's the missing write rights in this above mentioned program directory. But the error message "Out of memory" is not very helpful.

Also, after this happens, I tried to reload the saved "untitled.bas", but it was automatically deleted from QB64. This is ridiculous.
A program should ask always for a deletion permission.
But not QB64. It deletes without asking.

QB64 should give better error message texts, should point to a missing write permission and should not delete automatically an old copy of untitled.bas.

This was my first and last try, QB64 seems to be crap.

Posted on Nov 26, 2011, 6:33 AM

Respond to this message   

Return to Index


Re: Much room for improvements

by (Login MCalkins)
Moderator

>Much room for improvements

Yes there is.

>I have copied all QB64 program files to C:\Program Files\QB64 (Windows 7).

>Then I try to run it. "Out of memory". There are only a few "PRINT" statements and INPUT statements, so it is NOT related with the source itself.
>Instead, I suspect that it's the missing write rights in this above mentioned program directory. But the error message "Out of memory" is not very helpful.

I'm not sure if it makes a difference, but I wouldn't have put it under Program Files. If you suspect file permissions are the problem, make sure you have full access to the folder in question. I'm not sure if it makes a difference, but you might try running QB64 as administrator.

"Out of memory" is an error message QB64 borrowed from QBASIC.

>Also, after this happens, I tried to reload the saved "untitled.bas", but it was automatically deleted from QB64. This is ridiculous.
>A program should ask always for a deletion permission.
>But not QB64. It deletes without asking.

I'd tend to agree with you, except that if you know QB64 does it, you can work around it. QB64 should probably save the file somewhere in it's internal folder, instead of using untitled.bas in the main folder. You can compile from the command prompt with qb64 -c filename, if you want to avoid the IDE. If you don't feel safe putting your programs in the main folder, you can put them in a separate folder. If you're paranoid, you could even compile with a Batch program that copies the program from some other folder, and feeds QB64 the copy.

>QB64 should give better error message texts, should point to a missing write permission and should not delete automatically an old copy of untitled.bas.

I think you'll find there are plenty of programs that give confusing or misleading error messages under unexpected conditions. If the problem is what you say it is, you have the ability to remedy it. With regard to untitled.bas, that is a quirk, but as you now know about it, you can work around it. It doesn't sound like you lost any important code, so I don't understand the hostility.

The QB64 site has its own forums:

http://www.qb64.net/forum/

One of the subforums is specifically for reporting bugs or incompatibilities with QBASIC. Another is for asking Galleon a brief question. There is also a main discussion forum, where you could state your issues.

However, if you post there, it should probably be with the attitude of wanting assistance or trying to improve QB64, not just attacking it because you don't like it. Galleon has the final say on what gets changed and what doesn't.

>This was my first and last try, QB64 seems to be crap.

You seem quick to condemn. It's certainly your choice as to what software to use. I'd say don't be so quick to condemn a program that is under active development, and that has good potential. Galleon has said he intends to make QB64 more modular next year. I take that to mean it will behave more like a traditional compiler. So I'd be reluctant to rule out trying it again in the future. But if you don't like it, you don't have to use it. You're free to use FreeBASIC, MinGW, OpenWatcom, MS Visual Studio, even good old QBASIC 1.1, or whatever else suits your needs.

Regards,
Michael

Posted on Nov 26, 2011, 10:33 AM

Respond to this message   

Return to Index


Are you saying that you are losing existing BAS files?

by Clippy (no login)

If you are losing code that you entered in the Untitled IDE then the memory problem is doing that when the IDE closes. QB64 always asks if you want to save code entered even if it has not been compiled(run).

I'd say that you have permission problems or a lack of memory. QB64 seldom has memory problems!

Come to the forum if you cannot iron those problems out. www.QB64.net

Ted

Posted on Nov 26, 2011, 10:02 PM

Respond to this message   

Return to Index


Be consequent, stay away from you **** OS

by lisztfr (no login)

Windows 7 is a full bunch of stinking crap so stay away from this, because XP is far better. Also stay away from 64 bit, because 64 bit is truly just useless **** : See all benchmarks related to processors, the 64 bit improves the performance just a little, less than buying a better CPU.

If you like to run crap, go on. And Windows 7 is the greatest **** ever release, after the precedent catastrophic OS that i forgot the name, from Bill Gates,... well it was such a bunch of crap that it's already a dying platform.

Windows 7 is 50 % slower than XP (if the application starts, Gimp doesn't, Firefox takes ages ) and waste your resources, it is an unbelievable monster of ****. I prefer to get sick than running that Ok ? And you can't resize partitions in order to install linux beside, because it will just crash everything.

Cancel my post if you want, i hate windows 7 and useless crap.

Posted on Nov 27, 2011, 10:48 AM

Respond to this message   

Return to Index


You are entitled to your opinion.

by (Login MCalkins)
Moderator

I consider "crap" to be only mildly vulgar, so I left it, censoring the other word.

Aside from the absence of "quick launch", I prefer "7" (really 6.1) to Vista. Pinning stuff to the task bar just isn't the same.

Some of the things that might hurt Windows 6.x performance, like superfetch, can be disabled.

Anyway, you are entitled to your opinion.

Regards,
Michael

Posted on Nov 27, 2011, 1:00 PM

Respond to this message   

Return to Index


RE: This was my first and last try, QB64 seems to be crap.

by Galleon (no login)

Well, as it was your last try I won't hassle you by asking you to test some things our for me to diagnose the issue.

Thanks for the technical feedback. I'm inclined to go with Clippy's diagnosis which is that you have very little available RAM or it is a permissions or installation issue.

"A program should ask always for a deletion permission. But not QB64. It deletes without asking."
This is false. In fact, QB64 is more likely to save your program from accidental loss than any other programming IDE I know. For instance, after launching QB64 you can do CTRL+Z and back-track through changes made the last time the QB64 IDE was used!

Posted on Nov 28, 2011, 10:57 AM

Respond to this message   

Return to Index


* Darn, Michael just cleaned up that post too...:-)

by Clippy (no login)

Posted on Nov 28, 2011, 2:55 PM

Respond to this message   

Return to Index


Old QuickBasic 4.5 on a new Windows 7 PC Laptop?

by (no login)

I have QuickBasic 4.5 installed on an old 386 PC from 20 years ago. I have several old Programs which I need to be able to use on my new Windows 7 Home Premium Laptop. However, I cannot port them across, as the old machine has LPT and COM ports, but the new one only has USB etc. ports.
I guess I may have to rewrite, by copying from the Old screen to the new keyboard.
I also wish to use QuickBasic 4.5 (or a superset of it) on the new machine to write things like True RMS Convertors, Logging and Display software. Will this be possible?
I was very impressed by QB4.5 despite only ever using about 1% of its' commands, and do not wish to learn another BASIC, as I have used umpteen dialects already, since 1980....
If I use the DOS Prompt on my new machine, does it truly run in DOS, ie in the original DOS memory space, etc, or just a Windows mimicking of it, c/w interrupts(ions)?

Posted on Nov 24, 2011, 1:09 AM

Respond to this message   

Return to Index


Hello, Graham

by (Login MCalkins)
Moderator

Welcome to the forum.

There is probably some way of copying the files without needing to retype them:

The 386 machine probably has a floppy. You can probably buy/borrow a USB floppy drive for the laptop.

Or, you could buy/borrow a USB to RS232 adapter for the laptop, and use the serial ports. (you might have to write your own serial transfer program on both computers.)

Or, you can install an Ethernet adapter in the 386, if you can find one with a DOS driver on a floppy. But then you would still need some sort of transfer software. Maybe find a DOS FTP client on a floppy?

Perhaps you could buy/borrow a USB to IDE adapter, take the hard disk out of the 386, and hook it up to the laptop through the adapter. I assume it's IDE and not SCSI...

If your Windows 7 is 32 bit, then it has a DOS emulator, NTVDM, which will allow you some DOS functionality. However, it won't allow you to make your DOS programs full screen. If your Windows 7 is 64 bit, then it does not have NTVDM. In either case, you can install your own DOS emulator, such as DOSBox, or even a full machine emulator, such as Bochs or QEMU, into which you can install your choice of DOS version, perhaps FreeDOS or Caldera OpenDOS.

QB64 is a project under current development to provide a modern compiler compatible with QBASIC/QuickBASIC. It has a high degree of compatibility with QBASIC, and it is being improved:

www.qb64.net

>If I use the DOS Prompt on my new machine, does it truly run in DOS, ie in the original DOS memory space, etc, or just a Windows mimicking of it, c/w interrupts(ions)?

The Windows Command Prompt, "cmd.exe", is not a DOS prompt at all. It is a Windows command prompt, as is Power Shell. If your Windows is 32 bit, not 64 bit, then you have a DOS emulator, NTVDM, and a DOS prompt, "command.com". If you have 64 bit Windows, then there is no DOS environment at all, unless you install your own emulator.

NTVDM allows the DOS program to run directly on the actual microprocessor, which is switched into v86 mode for real mode DOS programs (like QBASIC), or can be in protected mode for protected mode DOS programs (like Heretic or Quake). If the DOS program attempts to access hardware directly, the attempt is caught by NTVDM, which either emulates the hardware access, or tells you that it can't. NTVDM emulates MS-DOS 5.0.

DOSBox does not let the DOS program run on the actual microprocessor. Instead, DOSBox emulates the microprocessor as well as the DOS environment.

Regards,
Michael

Posted on Nov 24, 2011, 7:33 PM

Respond to this message   

Return to Index


*VirtualBox is great

by Ben (no login)

Posted on Nov 27, 2011, 6:19 PM

Respond to this message   

Return to Index


Graham emailed me.

by (Login MCalkins)
Moderator

-------------------------------- His email:

Dear Michael,
Many thanks for your most Comprehensive reply.
In particular I am most grateful for it being in a language which even I can understand,
instead of the strange dialects of Computerspeak which normally inhabit these zones.
I now find that I have a 64 bit laptop, though it does have some "x86" files..., (perhaps just a manual),
which had given me the impression that it was 32/64 bit, if there is any such beast.
I am So looking forward to using QuickBasic once again,
which has been considerably hastened by your kind advice.
Once Again, Many Thanks.
Graham McLeod; "RF_Designer".

-------------------------------- My response here:

I'm glad that I could help.

32 bit Windows can run on a 64 bit chip. For example, I am right now running 32 bit Windows XP on an Intel Core 2 chip, which is 64 bit. However, it is probable that you have 64 bit Windows. You can tell by viewing your System properties from Control Panel.

http://support.microsoft.com/kb/827218

Click Start, type "System" without quotes, and click "System" in the list.

Please note that QB64 is a compiler for Windows (and Linux and Mac OS X), so it does not depend on DOS emulation. Contrary to its name, it doesn't target Win64, it targets Win32. The name is meant to imply that it will run on 64 bit Windows.

Regards,
Michael

Posted on Nov 25, 2011, 1:32 PM

Respond to this message   

Return to Index


guys check out my new program

by Ben (no login)

DEFINT A-Z
DECLARE SUB drawtabs ()
DECLARE SUB redit ()
DECLARE SUB drawdir ()
DECLARE FUNCTION getfiles (pp$, arr() AS STRING)

DIM SHARED f(10) AS LONG
f(0) = &H1EE58955
f(1) = &HB80656C5
f(2) = &H21CD1A00
f(3) = &H4CA5D1F
f(5) = &H8BE58955
f(6) = &H4E8B0656
f(7) = &HA768B08
f(8) = &H21CD048B
f(9) = &HCA5D0489
f(10) = &H6
DEF SEG = VARSEG(f(0))
TYPE dtatype
reserved AS STRING * 21
a AS STRING * 1
time AS INTEGER
date AS STRING * 2
size AS LONG
fname AS STRING * 13
END TYPE
DIM SHARED dta AS dtatype
DEF SEG = VARSEG(f(0))
CALL absolute(SEG dta, VARPTR(f(0)))

DIM SHARED t AS INTEGER, at AS INTEGER
t = 1
at = 1

DIM SHARED tt(10)
DIM SHARED ef(10) AS STRING
DIM SHARED es(10) AS INTEGER
DIM SHARED ex(10) AS INTEGER
DIM SHARED ey(10) AS INTEGER
DIM SHARED ms(10) AS INTEGER

DIM SHARED c(100, 7) AS STRING * 80

DIM SHARED cf(10) AS STRING
DIM SHARED cs AS INTEGER

DIM SHARED df(500) AS STRING
DIM SHARED d AS STRING
DIM SHARED dn AS INTEGER, ds AS INTEGER, dss AS INTEGER
d = "C:\"
dn = getfiles(d$, df())
ds = 0
dss = 0

SCREEN 0
VIEW PRINT 1 TO 25
CLS
drawtabs
drawdir

DO

k$ = RIGHT$(INKEY$, 1)
IF k$ <> "" THEN
IF (ASC(k$) > 58) AND (ASC(k$) < (59 + t)) THEN
at = ASC(k$) - 58
drawtabs
IF at = 1 THEN
CLS
drawtabs
drawdir
ELSE
SELECT CASE tt(at)
CASE 1
'CLS
'drawtabs
redit
END SELECT
END IF
END IF
END IF

SELECT CASE at
CASE 1
SELECT CASE k$
CASE "P"
IF dss < 23 THEN
IF dss < (dn - 1) THEN dss = dss + 1
ELSE
IF (ds + dss) < (dn - 1) THEN ds = ds + 1
END IF
drawdir
CASE "H"
IF dss > 0 THEN
dss = dss - 1
ELSE
IF ds > 0 THEN ds = ds - 1
END IF
drawdir
CASE CHR$(13)
LOCATE 3, 20
PRINT df(ds + dss) + SPACE$(13)
IF RTRIM$(df(ds + dss)) = "..\" THEN
IF RIGHT$(d, 2) <> ":\" THEN
FOR i = LEN(d) TO 2 STEP -1
IF MID$(d, i - 1, 1) = "\" THEN EXIT FOR
NEXT
d = LEFT$(d, i - 1)
dn = getfiles(d$, df())
END IF
ds = 0
dss = 0

CLS
drawtabs
drawdir
ELSEIF RIGHT$(RTRIM$(df(ds + dss)), 1) = "\" THEN
d = d + df(dss + ds)
dn = getfiles(d$, df())
ds = 0
dss = 0

CLS
drawtabs
drawdir
ELSEIF RIGHT$(RTRIM$(df(ds + dss)), 3) = "BAS" THEN
t = t + 1
at = t
tt(at) = 1
ef(at) = d + df(ds + dss)


OPEN ef(at) FOR INPUT AS #1
FOR i = 1 TO 100
IF EOF(1) THEN EXIT FOR
LINE INPUT #1, c(i, at)
NEXT
ms(at) = i
CLOSE


'CLS
'drawtabs
redit
END IF
END SELECT
CASE ELSE
SELECT CASE tt(at)
CASE 1

'''''''''

redit

DO
k$ = INKEY$
SELECT CASE k$

CASE CHR$(0) + "M"
IF ex(at) < 79 THEN ex(at) = ex(at) + 1
redit

CASE CHR$(0) + "K"
IF ex(at) > 0 THEN ex(at) = ex(at) - 1
redit

CASE CHR$(0) + "P"
IF ey(at) < 23 THEN
ey(at) = ey(at) + 1
ELSE
IF es(at) < ms(at) THEN es(at) = es(at) + 1
END IF
redit

CASE CHR$(0) + "H"
IF ey(at) > 0 THEN
ey(at) = ey(at) - 1
ELSE
IF es(at) > 0 THEN es(at) = es(at) - 1
END IF
redit


CASE CHR$(8)
IF ex(at) > 0 THEN
ex(at) = ex(at) - 1

tt$ = c(ey(at) + es(at) + 1, at)
c(ey(at) + es(at) + 1, at) = LEFT$(tt$, ex(at)) + RIGHT$(tt$, 79 - ex(at))
redit
END IF
CASE CHR$(13)
IF ey(at) < 23 THEN
ey(at) = ey(at) + 1
ELSE
IF es(at) < ms THEN es(at) = es(at) + 1
END IF
tt$ = RIGHT$(c(ey(at) + es(at), at), 80 - ex(at))
c(ey(at) + es(at), at) = LEFT$(c(ey(at) + es(at), at), ex(at))
FOR i = ms(at) - 1 TO (ey(at) + es(at) + 1) STEP -1
c(i + 1, at) = c(i, at)
NEXT
c(ey(at) + es(at) + 1, at) = tt$
ex(at) = 0
redit

CASE CHR$(32) TO CHR$(128)
ex(at) = ex(at) + 1
tt$ = RIGHT$(c(ey(at) + es(at) + 1, at), 81 - ex(at))
MID$(c(ey(at) + es(at) + 1, at), ex(at)) = k$ + tt$
redit
END SELECT


k$ = RIGHT$(k$, 1)
IF k$ <> "" THEN
IF (ASC(k$) > 58) AND (ASC(k$) < (59 + t)) THEN
at = ASC(k$) - 58
drawtabs
IF at = 1 THEN
CLS
drawtabs
drawdir
EXIT DO
ELSE
SELECT CASE tt(at)
CASE 1
CLS
drawtabs
redit
END SELECT
EXIT DO
END IF
END IF

END IF
IF INP(&H60) = 1 THEN SYSTEM
LOOP

'''''''''

END SELECT
END SELECT
LOOP UNTIL INP(&H60) = 1
SYSTEM

SUB drawdir
FOR i = 0 TO 23
IF (i + ds) > (dn - 1) THEN EXIT FOR
LOCATE i + 2, 1
IF dss = i THEN COLOR 0, 7 ELSE COLOR 7, 0
PRINT df(i + ds) + SPACE$(13 - LEN(df(i + ds)));
COLOR 7, 0
NEXT
LOCATE 2, 20
PRINT d + SPACE$(60 - LEN(d))
END SUB

DEFSNG A-Z
SUB drawtabs
COLOR 0, 7
LOCATE 1, 1
PRINT SPACE$(80);
FOR i = 1 TO t
LOCATE 1, ((80 \ t) * i) - (80 \ t \ 2)
PRINT LTRIM$(STR$(i));
NEXT

COLOR 0, 4
i = (80 \ t) * (at - 1)
IF i < 1 THEN i = 1
LOCATE 1, i
PRINT SPACE$(80 \ t)
LOCATE 1, ((80 \ t) * at) - (80 \ t \ 2)
PRINT LTRIM$(STR$(at));
COLOR 7, 0
END SUB

DEFINT A-Z
FUNCTION getfiles (pp$, arr() AS STRING)
DEF SEG = VARSEG(f(0))
p$ = pp$ + "*.*" + CHR$(0)
ax = &H4E00
CALL absolute(ax, BYVAL 16, BYVAL SADD(p$), VARPTR(f(5)))
FOR i = 0 TO UBOUND(arr) - 1
ax = &H4F00
CALL absolute(ax, 0, 0, VARPTR(f(5)))
IF ax AND &HF <> 0 THEN EXIT FOR
arr(i) = LEFT$(dta.fname, INSTR(dta.fname, CHR$(0)) - 1) + CHR$(32 + (dta.a = CHR$(16)) * -60)
NEXT
getfiles = i
END FUNCTION

SUB redit

SCREEN , , 1, 0
VIEW PRINT 1 TO 25
CLS
drawtabs

FOR i = es(at) + 1 TO es(at) + 23
PRINT c(i, at);
NEXT

COLOR 0, 7
LOCATE ey(at) + 2, ex(at) + 1
PRINT CHR$(SCREEN(ey(at) + 2, ex(at) + 1));
COLOR 7, 0

PCOPY 1, 0

SCREEN , , 0, 0
END SUB

Posted on Nov 20, 2011, 11:25 AM

Respond to this message   

Return to Index


*Works great in QB1.1 (QB64 has a problem with the user-defined data).

by (Login qb432l)
R

*

Posted on Nov 20, 2011, 7:13 PM

Respond to this message   

Return to Index


* more likely a problem with Absolute than TYPE

by Clippy (no login)

Posted on Nov 21, 2011, 5:23 AM

Respond to this message   

Return to Index


Actually, that's what I meant ...

by (Login qb432l)
R

...user-defined data in the CALL ABSOLUTE statement. QB64 (of course) doesn't object to user-defined data or CALL ABSOLUTE.

Anyway, again, great job, Ben. I watched your video and admit I wasn't aware of all its capabilities (although the music doesn't exactly say QBasic - lol!).

-Bob

Posted on Nov 21, 2011, 12:57 PM

Respond to this message   

Return to Index


disassembly

by (Login MCalkins)
Moderator

;debug style, not nasm style. numbers are hex without "0x".

;f(0)

PUSH    BP
MOV     BP,SP
PUSH    DS
LDS     DX,[BP+06]              ;ds:dx = pointer to dta
MOV     AX,1A00
INT     21                      ;DOS: Set DTA Address
POP     DS
POP     BP
RETF    0004

db 0
db 0
db 0

;f(5)

PUSH    BP
MOV     BP,SP
MOV     DX,[BP+06]              ;(Find first file): offset of ASCIIZ pathname
MOV     CX,[BP+08]              ;(Find first file): search attribute
MOV     SI,[BP+0A]              ;pointer to DOS function number
MOV     AX,[SI]                 ;DOS function number
INT     21                      ;DOS
MOV     [SI],AX                 ;error code (if carry)
POP     BP
RETF    0006

db 0
db 0

--------------------------------

The first function calls DOS:Set DTA address. It sets the DOS Disk Transfer Area address for future calls to Find first file and Find next file. The program calls it to point to the dta variable.

The second function calls either DOS:Find first file (function 0x4e), or DOS:Find next file (function 0x4f), depending on which is specified by the value of the ax variable. The 1st parameter is a near pointer to the variable ax.

In the case of Find first file, the 2nd parameter is the attributes, and the third parameter is near pointer to the the actual string part of p$.

In the case of Find next file, the 2nd and third parameters aren't significant.

the getfiles function adds "*.*"+chr$(0) to pp$, and uses that as the pathname. It uses an attributes flag of 16 (directory). This allows normal files and directories. I'm not sure if it allows archive files. It performs Find first file. It then loops, repeatedly calling Find next file, until the error code AND &f is true. It stores the file name in the arr array, appending "\" if it is a directory. It returns the number of files it found. Note that the result of Find first file is not stored in the array. An experiment on a sub folder seems to result in "." being the first (ignored) result, and ".." being the second (not ignored) result.

Win32 has comparable functions. I will look into adapting the code. My parents are in the room and turned the TV on, so the distractions have increased.

Regards,
Michael

Posted on Nov 21, 2011, 4:16 PM

Respond to this message   

Return to Index


modified for qb64 (win32)

by (Login MCalkins)
Moderator

I believe it is a bug in Ben's original to discard the result of Find first file for the root folder. On a subfolder, it seems to be ".", which can be discarded. But on the root, it is a valid file.

This version doesn't exclude system or hidden files the way Ben's original did. You could add code to filter the results based on the value of FindFileData.dwFileAttributes. See:

http://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx

for values.

Regards,
Michael

Edit: The filenames from FindFileData.cFileName needed to be forced to uppercase.

Edit (12:14 AM): removed an unnecessary SYSTEM.

--------------------------------

DEFINT A-Z
DECLARE SUB drawtabs ()
DECLARE SUB redit ()
DECLARE SUB drawdir ()
DECLARE FUNCTION getfiles (pp$, arr() AS STRING)

CONST MAX_PATH = 260
CONST INVALID_HANDLE_VALUE = -1
CONST FILE_ATTRIBUTE_DIRECTORY = 16
CONST ERROR_NO_MORE_FILES = 18

DECLARE DYNAMIC LIBRARY "kernel32"
 FUNCTION FindFirstFileA%& (BYVAL lpFileName AS _OFFSET, BYVAL lpFindFileData AS _OFFSET)
 FUNCTION FindNextFileA& (BYVAL hFindFile AS _OFFSET, BYVAL lpFindFileData AS _OFFSET)
 FUNCTION FindClose& (BYVAL hFindHandle AS _OFFSET)
 FUNCTION GetLastError~& ()
END DECLARE

TYPE WIN32_FIND_DATA
 dwFileAttributes AS _UNSIGNED LONG
 ftCreationTime AS _UNSIGNED _INTEGER64 'msdn says this can cause alignment faults on win64
 ftLastAccessTime AS _UNSIGNED _INTEGER64
 ftLastWriteTime AS _UNSIGNED _INTEGER64
 nFileSizeHigh AS _UNSIGNED LONG
 nFileSizeLow AS _UNSIGNED LONG
 dwReserved0 AS _UNSIGNED LONG
 dwReserved1 AS _UNSIGNED LONG
 cFileName AS STRING * MAX_PATH
 cAlternateFileName AS STRING * 14
END TYPE
DIM SHARED FindFileData AS WIN32_FIND_DATA

DIM SHARED t AS INTEGER, at AS INTEGER
t = 1
at = 1

DIM SHARED tt(10)
DIM SHARED ef(10) AS STRING
DIM SHARED es(10) AS INTEGER
DIM SHARED ex(10) AS INTEGER
DIM SHARED ey(10) AS INTEGER
DIM SHARED ms(10) AS INTEGER

DIM SHARED c(100, 7) AS STRING * 80

DIM SHARED cf(10) AS STRING
DIM SHARED cs AS INTEGER

DIM SHARED df(500) AS STRING
DIM SHARED d AS STRING
DIM SHARED dn AS INTEGER, ds AS INTEGER, dss AS INTEGER
d = "C:\"
dn = getfiles(d$, df())
ds = 0
dss = 0

SCREEN 0
VIEW PRINT 1 TO 25
CLS
drawtabs
drawdir

DO

 k$ = RIGHT$(INKEY$, 1)
 IF k$ <> "" THEN
  IF (ASC(k$) > 58) AND (ASC(k$) < (59 + t)) THEN
   at = ASC(k$) - 58
   drawtabs
   IF at = 1 THEN
    CLS
    drawtabs
    drawdir
   ELSE
    SELECT CASE tt(at)
     CASE 1
      'CLS
      'drawtabs
      redit
    END SELECT
   END IF
  END IF
 END IF

 SELECT CASE at
  CASE 1
   SELECT CASE k$
    CASE "P"
     IF dss < 23 THEN
      IF dss < (dn - 1) THEN dss = dss + 1
     ELSE
      IF (ds + dss) < (dn - 1) THEN ds = ds + 1
     END IF
     drawdir
    CASE "H"
     IF dss > 0 THEN
      dss = dss - 1
     ELSE
      IF ds > 0 THEN ds = ds - 1
     END IF
     drawdir
    CASE CHR$(13)
     LOCATE 3, 20
     PRINT df(ds + dss) + SPACE$(13)
     IF RTRIM$(df(ds + dss)) = "..\" THEN
      IF RIGHT$(d, 2) <> ":\" THEN
       FOR i = LEN(d) TO 2 STEP -1
        IF MID$(d, i - 1, 1) = "\" THEN EXIT FOR
       NEXT
       d = LEFT$(d, i - 1)
       dn = getfiles(d$, df())
      END IF
      ds = 0
      dss = 0

      CLS
      drawtabs
      drawdir
     ELSEIF RIGHT$(RTRIM$(df(ds + dss)), 1) = "\" THEN
      d = d + df(dss + ds)
      dn = getfiles(d$, df())
      ds = 0
      dss = 0

      CLS
      drawtabs
      drawdir
     ELSEIF RIGHT$(RTRIM$(df(ds + dss)), 3) = "BAS" THEN
      t = t + 1
      at = t
      tt(at) = 1
      ef(at) = d + df(ds + dss)


      OPEN ef(at) FOR INPUT AS #1
      FOR i = 1 TO 100
       IF EOF(1) THEN EXIT FOR
       LINE INPUT #1, c(i, at)
      NEXT
      ms(at) = i
      CLOSE


      'CLS
      'drawtabs
      redit
     END IF
   END SELECT
  CASE ELSE
   SELECT CASE tt(at)
    CASE 1

     '''''''''

     redit

     DO
      k$ = INKEY$
      SELECT CASE k$

       CASE CHR$(0) + "M"
        IF ex(at) < 79 THEN ex(at) = ex(at) + 1
        redit

       CASE CHR$(0) + "K"
        IF ex(at) > 0 THEN ex(at) = ex(at) - 1
        redit

       CASE CHR$(0) + "P"
        IF ey(at) < 23 THEN
         ey(at) = ey(at) + 1
        ELSE
         IF es(at) < ms(at) THEN es(at) = es(at) + 1
        END IF
        redit

       CASE CHR$(0) + "H"
        IF ey(at) > 0 THEN
         ey(at) = ey(at) - 1
        ELSE
         IF es(at) > 0 THEN es(at) = es(at) - 1
        END IF
        redit


       CASE CHR$(8)
        IF ex(at) > 0 THEN
         ex(at) = ex(at) - 1

         tt$ = c(ey(at) + es(at) + 1, at)
         c(ey(at) + es(at) + 1, at) = LEFT$(tt$, ex(at)) + RIGHT$(tt$, 79 - ex(at))
         redit
        END IF
       CASE CHR$(13)
        IF ey(at) < 23 THEN
         ey(at) = ey(at) + 1
        ELSE
         IF es(at) < ms THEN es(at) = es(at) + 1
        END IF
        tt$ = RIGHT$(c(ey(at) + es(at), at), 80 - ex(at))
        c(ey(at) + es(at), at) = LEFT$(c(ey(at) + es(at), at), ex(at))
        FOR i = ms(at) - 1 TO (ey(at) + es(at) + 1) STEP -1
         c(i + 1, at) = c(i, at)
        NEXT
        c(ey(at) + es(at) + 1, at) = tt$
        ex(at) = 0
        redit

       CASE CHR$(32) TO CHR$(128)
        ex(at) = ex(at) + 1
        tt$ = RIGHT$(c(ey(at) + es(at) + 1, at), 81 - ex(at))
        MID$(c(ey(at) + es(at) + 1, at), ex(at)) = k$ + tt$
        redit
      END SELECT


      k$ = RIGHT$(k$, 1)
      IF k$ <> "" THEN
       IF (ASC(k$) > 58) AND (ASC(k$) < (59 + t)) THEN
        at = ASC(k$) - 58
        drawtabs
        IF at = 1 THEN
         CLS
         drawtabs
         drawdir
         EXIT DO
        ELSE
         SELECT CASE tt(at)
          CASE 1
           CLS
           drawtabs
           redit
         END SELECT
         EXIT DO
        END IF
       END IF

      END IF
      IF INP(&H60) = 1 THEN SYSTEM
     LOOP

     '''''''''

   END SELECT
 END SELECT
LOOP UNTIL INP(&H60) = 1
SYSTEM

SUB drawdir
FOR i = 0 TO 23
 IF (i + ds) > (dn - 1) THEN EXIT FOR
 LOCATE i + 2, 1
 IF dss = i THEN COLOR 0, 7 ELSE COLOR 7, 0
 PRINT df(i + ds) + SPACE$(13 - LEN(df(i + ds)));
 COLOR 7, 0
NEXT
LOCATE 2, 20
PRINT d + SPACE$(60 - LEN(d))
END SUB

DEFSNG A-Z
SUB drawtabs
COLOR 0, 7
LOCATE 1, 1
PRINT SPACE$(80);
FOR i = 1 TO t
 LOCATE 1, ((80 \ t) * i) - (80 \ t \ 2)
 PRINT LTRIM$(STR$(i));
NEXT

COLOR 0, 4
i = (80 \ t) * (at - 1)
IF i < 1 THEN i = 1
LOCATE 1, i
PRINT SPACE$(80 \ t)
LOCATE 1, ((80 \ t) * at) - (80 \ t \ 2)
PRINT LTRIM$(STR$(at));
COLOR 7, 0
END SUB

DEFINT A-Z
FUNCTION getfiles (pp$, arr() AS STRING)
DIM handle AS _OFFSET
DIM n AS LONG
p$ = pp$ + "*" + CHR$(0)
handle = FindFirstFileA(_OFFSET(p$), _OFFSET(FindFileData))
IF handle = INVALID_HANDLE_VALUE THEN
 PRINT "FindFirstFileA failed. Error: 0x" + LCASE$(HEX$(GetLastError))
 SYSTEM
 'getfiles = 0: exit function
END IF
IF LEFT$(FindFileData.cAlternateFileName, 1) = CHR$(0) THEN
 arr(0) = UCASE$(LEFT$(FindFileData.cFileName, INSTR(FindFileData.cFileName, CHR$(0)) - 1)) + CHR$(32 + (FindFileData.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY) * -60)
ELSE
 arr(0) = LEFT$(FindFileData.cAlternateFileName, INSTR(FindFileData.cAlternateFileName, CHR$(0)) - 1) + CHR$(32 + (FindFileData.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY) * -60)
END IF
IF arr(0) <> ".\" THEN i = 1 ELSE i = 0
FOR i = i TO UBOUND(arr) - 1
 IF FindNextFileA(handle, _OFFSET(FindFileData)) THEN
  IF LEFT$(FindFileData.cAlternateFileName, 1) = CHR$(0) THEN
   arr(i) = UCASE$(LEFT$(FindFileData.cFileName, INSTR(FindFileData.cFileName, CHR$(0)) - 1)) + CHR$(32 + (FindFileData.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY) * -60)
  ELSE
   arr(i) = LEFT$(FindFileData.cAlternateFileName, INSTR(FindFileData.cAlternateFileName, CHR$(0)) - 1) + CHR$(32 + (FindFileData.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY) * -60)
  END IF
 ELSE
  n = GetLastError
  IF n = ERROR_NO_MORE_FILES THEN
   IF FindClose(handle) = 0 THEN PRINT "FindClose failed. Error: 0x" + LCASE$(HEX$(GetLastError)): SYSTEM
   EXIT FOR
  ELSE
   PRINT "FindNextFileA failed. Error: 0x" + LCASE$(HEX$(n))
   SYSTEM
  END IF
 END IF
NEXT
getfiles = i
END FUNCTION

SUB redit

SCREEN , , 1, 0
VIEW PRINT 1 TO 25
CLS
drawtabs

FOR i = es(at) + 1 TO es(at) + 23
 PRINT c(i, at);
NEXT

COLOR 0, 7
LOCATE ey(at) + 2, ex(at) + 1
PRINT CHR$(SCREEN(ey(at) + 2, ex(at) + 1));
COLOR 7, 0

PCOPY 1, 0

SCREEN , , 0, 0
END SUB

Posted on Nov 21, 2011, 8:29 PM

Respond to this message   

Return to Index


I got an error in QB64, Michael...

by (Login qb432l)
R

From line 13: FindFirstFileA%&

QB64 expects &H or &O -- is it perhaps a Network54 editor error as with greater-than, lesser-than symbols?

-Bob

Posted on Nov 21, 2011, 10:41 PM

Respond to this message   

Return to Index


Do you have QB64 version 0.942?

by (Login MCalkins)
Moderator

It's a fairly large download if you have dial up.

http://www.qb64.net/forum/index.php?topic=4404.0

http://www.qb64.net/qb64v0942-win.zip

Regards,
Michael

Posted on Nov 21, 2011, 11:07 PM

Respond to this message   

Return to Index


*Aha! That must be it. Sorry (I have high speed, so no problem).

by (Login qb432l)
R

*

Posted on Nov 21, 2011, 11:43 PM

Respond to this message   

Return to Index


* The update took an hour to run so get the ZIP file to do it fast

by Clippy (no login)

Posted on Nov 22, 2011, 8:20 AM

Respond to this message   

Return to Index


*Still haven't got there, but thanks for the info :-)

by (Login qb432l)
R

*

Posted on Nov 22, 2011, 3:51 PM

Respond to this message   

Return to Index


dir listing for qb64

by Ben (no login)

I recommend qb64 implement the dir function to work exactly like the one in freebasic. It's very simple to use, but it has to be multi platform.

http://www.freebasic.net/wiki/wikka.php?wakka=keyPgdir

Posted on Nov 29, 2011, 12:50 PM

Respond to this message   

Return to Index


Already done! Just need optional parameter like PDS, not FB

by (Login burger2227)
R

Posted on Nov 29, 2011, 6:31 PM

Respond to this message   

Return to Index


* SYSTEM should have been END in my modifications

by (Login MCalkins)
Moderator

Posted on Dec 6, 2011, 6:49 AM

Respond to this message   

Return to Index


* BTW, nice program example!

by (Login burger2227)
R

Posted on Dec 6, 2011, 7:25 AM

Respond to this message   

Return to Index


* Thanks for sharing this!

by Dav (no login)

Posted on Dec 6, 2011, 9:58 AM

Respond to this message   

Return to Index


it's a tabbed text editor

by Ben (no login)

at the moment, you can only select BAS files, which will open in a new tab and you can edit them using the keyboard, arrow keys, and back space.

You can switch tabs using the F keys (F1,F2,etc). Here is a video I took of me using it (if anyone gives a ****):
http://www.youtube.com/watch?v=ZcmMOkhcDNk

Posted on Nov 21, 2011, 10:36 AM

Respond to this message   

Return to Index


Numerous unnecessary and/or obscene posts removed.

by (Login MCalkins)
Moderator

There wasn't much point in them other than that Clippy doesn't like Ben's choice of music, and several people on this forum don't like each other.

Regards,
Michael

Posted on Nov 23, 2011, 5:46 PM

Respond to this message   

Return to Index


It is not about my taste in music! It is obsene music!

by Clippy (no login)

The background music music is about men having sex with boys!

Is that a good way to demonstrate code?

Posted on Nov 24, 2011, 9:05 AM

Respond to this message   

Return to Index


Re: It is not about my taste in music! It is obsene music!

by (Login MCalkins)
Moderator

Perhaps Ben should have included a message with the link saying that the audio content is likely to be offensive. I won't delete the link, because it is QBASIC related.

You have the options of leaving comments or "dislike"ing it on Youtube.

Regards,
Michael

Posted on Nov 24, 2011, 8:05 PM

Respond to this message   

Return to Index


That is up to you, but I find it offensive and not relevant to anything Basic

by Clippy (no login)

It does not demonstrate anything more than a program editor that could have been written in any language. It doesn't teach anybody anything and it encourages more of the same.

If he posted that at my site, I'd have tossed him and the link off the site!

Posted on Nov 24, 2011, 9:31 PM

Respond to this message   

Return to Index


Com port not communicating

by Docfxit (Login Docfxit)
R



wsFileNum% = FREEFILE ' get an unused file number
CONST comMode$ = "9600,N,8,1,CS6000,DS6000"
comPort$ = "COM1:"
OPEN comPort$ + comMode$ FOR RANDOM AS #wsFileNum

Does anyone know why wsFileNum = 0 when running this code?

Thanks,

Docfxit

Posted on Nov 15, 2011, 4:33 PM

Respond to this message   

Return to Index


* wsFileNum% and wsFileNum are 2 different variables

by (Login burger2227)
R

Posted on Nov 15, 2011, 5:26 PM

Respond to this message   

Return to Index


Re: * wsFileNum% and wsFileNum are 2 different variables

by Docfxit (Login Docfxit)
R

So would this fix it?

wsFileNum = FREEFILE ' get an unused file number
CONST comMode$ = "9600,N,8,1,CS6000,DS6000"
comPort$ = "COM1:"
OPEN comPort$ + comMode$ FOR RANDOM AS wsFileNum


What is the difference between wsFileNum and #wsFileNum

Thanks,

Docfxit

Posted on Nov 15, 2011, 6:53 PM

Respond to this message   

Return to Index


* Nothing, both are SINGLE. Add % and it becomes an INTEGER, but both need it.

by (Login burger2227)
R

Posted on Nov 15, 2011, 7:59 PM

Respond to this message   

Return to Index


Re: * Nothing, both are SINGLE. Add % and it becomes an INTEGER, but both need it.

by Docfxit (Login Docfxit)
R

So your saying this is what it should be?

wsFileNum% = FREEFILE ' get an unused file number
CONST comMode$ = "9600,N,8,1,CS6000,DS6000"
comPort$ = "COM1:"
OPEN comPort$ + comMode$ FOR RANDOM AS wsFileNum%

And not this:

wsFileNum% = FREEFILE ' get an unused file number
CONST comMode$ = "9600,N,8,1,CS6000,DS6000"
comPort$ = "COM1:"
OPEN comPort$ + comMode$ FOR RANDOM AS #wsFileNum

Thanks,

Docfxit

Posted on Nov 16, 2011, 8:01 AM

Respond to this message   

Return to Index


data types

by (Login MCalkins)
Moderator

QBasic has a system of data type suffixes that can be used with variable names to determine data type:

% is INTEGER
& is LONG
! is SINGLE
# is DOUBLE
$ is variable length STRING

Because you are not using any DEFxxx statements, the default data type is SINGLE. If you had used DEFINT A-Z, for example, then the default data type would be INTEGER.

By adding % to the end of the variable name, you specify it to be an INTEGER. As Clippy pointed out, wsFileNum% and wsFileNum! are two different variables.

Depending on personal preference, you might wish to avoid data type suffixes to the extent possible. It is considered by some people (including me) good practice to explicitly declare all of your variables:

DIM wsFileNum AS INTEGER

The # on the OPEN statement is optional. It is not a data type suffix, it is a reference to the fact that you are specifying a file number.

To answer your question, yes, the first example is correct. The second example would only be correct if you had used DIM wsFileNum AS INTEGER, or something like DEFINT A-Z. Another functionally equivalent example is:

DIM comPort AS STRING
DIM wsFileNum AS INTEGER

wsFileNum = FREEFILE
CONST comMode = "9600,N,8,1,CS6000,DS6000"
comPort = "COM1:"
OPEN comPort + comMode FOR RANDOM AS wsFileNum

On QB64, I'd possibly make wsFileNum a LONG instead of an INTEGER.

Regards,
Michael

Posted on Nov 16, 2011, 11:03 AM

Respond to this message   

Return to Index


I seriously doubt anyone will want to have over 32 thousand files open...:-)

by (Login burger2227)
R

SINGLE would cover that anyhow. 9,999,999 is enough...

Posted on Nov 16, 2011, 12:19 PM

Respond to this message   

Return to Index


*Great explanation Thank you very much. That really helped.

by Docfxit (Login Docfxit)
R

Posted on Nov 16, 2011, 2:06 PM

Respond to this message   

Return to Index


yw

by (Login MCalkins)
Moderator

It's standard practice on these forums to use an asterisk to mark empty posts, that is, posts that have a title, but no interior message.

Regards, Michael

Posted on Nov 16, 2011, 11:44 PM

Respond to this message   

Return to Index


Well, there goes another QB site.

by (Login ComputerGhost)
R

I thought we once had a subforum for posts like this? Maybe my memory serves me wrong.

It's a bit late, and I don't know if anyone will miss my old tutorials and QB command reference, but <http://www.peltkore.net/~computerghost/QBasic.htm> is no more. My host wanted to use the server for business purposes.

My old OLD website <http://www.freewebs.com/computerghost> seems to still be up and has the content on it. The page doesn't seem to work well, so here's the direct link to the QBasic section: <http://www.freewebs.com/computerghost/qbasic.htm>.

I do plan to put the site back up at some time in the future, once I knock these other projects I have out and have time to design a better website than my previous two.

All that said, I hope that the QBasic forum community is doing well, and I bid you all a good night! Au revoir!

-- Nathan

Posted on Nov 11, 2011, 7:54 PM

Respond to this message   

Return to Index


*P.S. I'm sorry some of the links don't work. I can get those pages for anyone interested.

by (Login ComputerGhost)
R

Posted on Nov 11, 2011, 7:57 PM

Respond to this message   

Return to Index


*Good luck, CG!

by (Login qb432l)
R

*

Posted on Nov 11, 2011, 9:14 PM

Respond to this message   

Return to Index


Yeah, good to see that you are still around CG.

by (Login burger2227)
R

Me and bob are lonely here a lot...

Posted on Nov 12, 2011, 4:00 PM

Respond to this message   

Return to Index


*Don't give him the wrong idea -- I also have a goldfish to help keep me company.

by (Login qb432l)
R

*

Posted on Nov 13, 2011, 9:45 AM

Respond to this message   

Return to Index


* That goldfish is NOT gonna like your igloo! :-)

by (Login burger2227)
R

Posted on Nov 13, 2011, 1:03 PM

Respond to this message   

Return to Index


* I'm here, looking in at least once or twice a day.

by Solitaire (Login Solitaire1)
S

Posted on Nov 13, 2011, 12:08 PM

Respond to this message   

Return to Index


I see you ,but you don't say much...

by (Login burger2227)
R

How is .NET treating you? I hope their forums are more active than this.

Posted on Nov 13, 2011, 1:35 PM

Respond to this message   

Return to Index


Yes, the .NET forums are very active.

by Solitaire (Login Solitaire1)
S

There are literally dozens of them, each dedicated to a single specialty.  I usually frequent the VB Express forum (where I am also known as Solitaire):

http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/threads

But I often come back to the simplicity of QB in order to test the logic of some code before translating it into VB.

Posted on Nov 13, 2011, 3:29 PM

Respond to this message   

Return to Index


Oh, I still haunt these forums a few times a week...

by (Login ComputerGhost)
R

I mostly keep a look-out in the linux and C++ subforums. I haven't used QBasic in years.

Posted on Nov 13, 2011, 7:48 PM

Respond to this message   

Return to Index


*because you are a ghost hahahaha

by george (no login)

Posted on Nov 13, 2011, 11:11 PM

Respond to this message   

Return to Index


Can't open short GW Basic program with QB64

by (no login)

I have an old GW Basic program that causes the QB64 install on my 2009 Mac to hang with an IDE module error when opened:

http://dl.dropbox.com/u/4147630/IDE%20Module%20error.png


When I click OK, QB64 crashes and the System can't restart it.


Can anyone tell me what the problem is? The program is here:

http://dl.dropbox.com/u/4147630/Dialog3Demo/CONDFORM.BAS


Posted on Nov 10, 2011, 4:13 PM

Respond to this message   

Return to Index


What is all of the ASCII garbage?

by (Login burger2227)
R

Can you read the ALL of the code in a text editor before you run it?

It looks like the text was formatted by QB4.5 when it was saved. If you have QB4.5 Save As text readable.

Posted on Nov 10, 2011, 4:48 PM

Respond to this message   

Return to Index


It is tokenized

by (no login)

Can't read code in text editor.

The program is tokenized and I have no "Save as text" option in the current implementation. Might be possible to boot directly, not in DosBox, and save as text.

Posted on Nov 11, 2011, 1:46 AM

Respond to this message   

Return to Index


Re: It is tokenized

by (Login MCalkins)
Moderator

You needed to go into gwbasic, type:
load "condform.bas"
save "condform.txt", a

Regards,
Michael


10 REM ===== THIS PROGRAM MUST BE IMPLEMENTED ON A SYSTEM THAT ACCEPTS A
20 REM ===== STATEMENT THAT READS A CHARACTER FROM THE KEYBOARD WHITHOUT
30 REM ===== INTERRUPTING THE PROGRAM (E.G. INKEY$).
40 GOSUB 1290
50 REM ===== CLEAR THE SCREEN
60 PRINT "*** DIALOG SUPPORT SYSTEM ***"
70 PRINT "COPYRIGHT DAVID STODOLSKY, 1986"
80 PRINT
90 PRINT "PRESS RETURN FOR INSTRUCTIONS"
100 INPUT Z$
110 GOSUB 1290
120 GOSUB 1340
130 DIM N6$(20)
140 DIM G$(30)
150 DIM U(20)
160 DIM Q(20)
170 FOR I = 0 TO 26
180     READ G$(I)
190 NEXT I
200 LET P = 36
210 PRINT "PROGRAM LOOPS PER SECOND SET TO "; P
220 GOTO 280
230 LET S7 = S7 + 1
240 LET S1 = S7 / P
250 LET C = S1
260 REM ----- C = CURRENT TIME
270 RETURN
280 REM ===== INITIALIZATION ==================================
290 PRINT "TURN LIMIT (SEC.)";
300 INPUT T
310 REM ----- T = TURN LIMIT
320 PRINT "DISCUSSION LIMIT (MIN.)";
330 INPUT D
340 LET D = D * 60
350 REM ----- D = DISCUSSION LIMIT
360 PRINT "NUMBER OF PEOPLE";
370 INPUT N2
380 FOR N1 = 1 TO N2
390     PRINT "NAME "; G$(N1)
400     INPUT N6$(N1)
410 NEXT N1
420 PRINT "IF A PERSON GETS INTERRUPTED, SHALL HE OR SHE"
430 PRINT "BE REMOVED FROM THE QUEUE? (Y/N) ";
440 INPUT P$
450 IF P$ = "Y" THEN 510
460 IF P$ = "y" THEN 510
470 IF P$ = "n" THEN 510
480 PRINT
490 IF P$ = "N" THEN 510
500 GOTO 420
510 GOSUB 1290
520 PRINT D/60;" MIN.CONFERENCE. ";T;" SEC. TURNS."
530 GOSUB 580
540 PRINT "TIME IS UP. ************"
550 BEEP
560 BEEP
570 END
580 REM ================================================  DIALOG SUBRUTINE
590 GOSUB 230
600 REM ----- E IS THE END OF DISCUSSION TIME
610 LET E = C + D
620 GOSUB 230
630 PRINT "DISCUSSION TIME LEFT ";INT(E - C);" SECONDS."
640 GOSUB 670
650 IF C < E THEN 620
660 RETURN
670 REM ================================================  SELECT SUBRUTINE
680 GOSUB 1120
690 GOSUB 230
700 IF R=0 THEN 750
710 REM ----- R = RESPONSE, 1-9 = REQUEST, 0 = RELEASE
720 IF C < N THEN 680
730 REM ----- N = END OF TURN LIMIT
740 REM ----- U IS TIME USED
750 LET U(S9) = U(S9) + C - S
760 REM ----- S IS START TIME
770 REM ----- M IS THE MINIMUM ELAPSED TIME
780 LET M = 10 ^ 37
790 LET N = C
800 LET G1 = 0
810 LET L = S9
820 LET S9 = N2 + 1
830 FOR F = 1 TO N2
840     IF Q(F) = 0 THEN 910
850     IF U(F) > M THEN 910
860     LET G1 = 1
870     LET M = U(F)
880     LET N = C + T
890     LET S9 = F
900     LET X$ = N6$(S9)
910 NEXT F
920 IF G1 = 0 THEN GOTO 1070
930 PRINT "CURRENT SPEAKER IS ";X$
940 LET R = S9
950 LET S = C
960 IF L = S9 THEN GOTO 1060
970 IF P$ = "N" THEN 1010
980 IF P$ = "n" THEN 1010
990 LET Q(L) = 0
1000 REM ----- 920-950 IS ADEQUATE FOR PRODUCING BEEPS ON SOME MACHINES
1010 REM ----- LET S8 = -16336
1020 REM ----- FOR A = 1 TO 5
1030 REM ----- LET B = PEEK (S8) - PEEK (S8) + PEEK (S8) - PEEK (S8)
1040 REM ----- NEXT A
1050 BEEP
1060 RETURN
1070 PRINT "WAITING FOR A NEW SPEAKER"
1080 GOTO 950
1090 REM ================================================  DISPLAY SUBRUTINE
1100 PRINT W$
1110 RETURN
1120 REM ===============================================  COLLECT SUBRUTINE
1130 LET W$ = "ENTER REQUEST"
1140 LET L$ = INKEY$
1150 IF L$ = "" THEN 1260
1160 FOR I = 0 TO 9
1170     IF L$ = G$(I) THEN GOTO 1270
1180 NEXT I
1190 REM ----- SPEAKER INDICATES END
1200 IF R = 0 THEN 1230
1210 LET Q(R) = 1
1220 GOTO 1240
1230 LET Q(S9) = 0
1240 LET W$ = N6$(R)
1250 GOSUB 1090
1260 RETURN
1270 LET R = I
1280 GOTO 1190
1290 REM ================================================  CLEAR THE SCREEN SUB
1300 FOR I = 1 TO 24
1310     PRINT
1320 NEXT I
1330 RETURN
1340 REM ===============================================  INSTRUCTIONS
1350 PRINT "THIS PROGRAM MEDIATES DIALOG"
1360 PRINT "BY RESOLVING CONFLICTING REQUESTS"
1370 PRINT "TO SPEAK IN FAVOR OF THE PERSON"
1380 PRINT "WHO HAS THUS FAR SPOKEN THE LEAST."
1390 PRINT "ASSIGN EACH PERSON A CARD"
1400 PRINT "LETTERED A THROUGH Z."
1410 PRINT "ENTER THE LETTER WHEN THEY"
1420 PRINT "HOLD UP THE CARD."
1430 PRINT
1440 PRINT "                   PRESS RETURN FOR MORE."
1450 INPUT Z$
1460 GOSUB 1290
1470 PRINT " WHEN THE PERSON FINISHES "
1480 PRINT "ENTER A ZERO AND THE NAME"
1490 PRINT "OF THE NEXT SPEAKER WILL"
1500 PRINT "APPEAR."
1510 PRINT
1520 PRINT " THE PROGRAM WILL ASK FOR THE"
1530 PRINT "NUMBER OF SECONDS EACH TURN WILL "
1540 PRINT "BE LIMITED TO, THE TIME LIMIT"
1550 PRINT "FOR THE DISCUSSION IN MINUTES,"
1560 PRINT "AND THE NUMBER OF SPEAKERS."
1570 PRINT "AFTER THE NAMES HAVE BEEN"
1580 PRINT "ENTERED THE PROGRAM WILL START."
1590 PRINT "                   PRESS RETURN FOR MORE."
1600 INPUT Z$
1610 GOSUB 1290
1620 PRINT "WHEN THE TIME RUNS OUT"
1630 PRINT "THE PROGRAM TERMINATES!"
1640 PRINT
1650 PRINT "PRESS RETURN TO START"
1660 INPUT Z$
1670 RETURN
1680 DATA 0,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
1690 REM ===============================================  VARIABLE NAMES
1700 REM   C     CURRENT TIME
1710 REM   D     DISCUSSION LIMIT
1720 REM   E     END OF DISCUSSION TIME
1730 REM   F     A COUNTER
1740 REM   G1    IF G1 = 0 THEN OUTPUT IS "WAITING FOR A NEW SPEAKER"
1750 REM         IF G1 = 1 THEN OUTPUT IS "CURRENT SPEAKER IS"...
1760 REM   I     A COUNTER
1770 REM   L     THE NUMBER OF THE PERSON WHO IS SPEAKING
1780 REM   L$    THE CHARACTER THAT IS RETURNED BY INKEY$
1790 REM   M     THE MINIMUM ELAPSED TIME
1800 REM   N     END OF TURN LIMIT (C + T)
1810 REM   N1    A COUNTER
1820 REM   N2    NUMBER OF PEOPLE
1830 REM   N6$   AN ARRAY WITH NAMES OF PERSONS IN THE DISCUSSION
1840 REM   P$    CAN BE "Y" OR "N". DETERMINES IF A PERSON WHO IS
1850 REM         INTERUPTED GETS THROWN OUT OF THE QUE
1860 REM   Q     REQUEST TO SPEAK. IN Q(N) IS A NUMBER THAT SIGNIFIES
1870 REM         IF PERSON N WANTS TO SPEAK (1) OR WANTS TO FINISH
1880 REM         SPEAKING (0).
1890 REM   R     RESPONSE (1-9 = REQUEST, 0 = RELEASE)
1900 REM   S     START TIME
1910 REM   S1    HAS TO DO WITH THE "CLOCK"
1920 REM   S7    HAS ALSO TO DO WITH THE "CLOCK"
1930 REM   S9    THE NUMBER OF THE PERSON WHO HAS THUS FAR SPOKEN THE
1940 REM         LEAST OF THE PERSON WHO WANTS TO SPEAK
1950 REM   T     TURN LIMIT
1960 REM   U     IN U(N) IS THE TIME PERSON N HAS USED
1970 REM   W$    TEXT THAT SHALL BE PRINTED ON THE SCREEN
1980 REM   X$    THE NAME OF THE CURRENT SPEAKER
1990 REM   Z$    INPUT OF RETURN
2000 REM ===============================================  SUBROUTINE LOCATIONS
2010 REM  580 - 660  DIALOG SUBROUTINE
2020 REM  670 - 1080 SELECT SUBROUTINE
2030 REM 1090 - 1110 DISPLAY SUBROUTINE
2040 REM 1120 - 1280 COLLECT SUBROUTINE
2050 REM 1290 - 1330 CLEAR THE SCREEN SUBROUTINE
2060 REM 1340 - 1680 INSTRUCTIONS
2070 REM 1690 - 1990 VARIABLE NAMES
2080 REM 2000 - 2080 SUBROUTINE LOCATIONS

Posted on Nov 11, 2011, 5:59 AM

Respond to this message   

Return to Index


thanks

by (no login)

Thanks for text. The save command doesn't work for me.

Posted on Nov 11, 2011, 11:33 AM

Respond to this message   

Return to Index


*yw.

by (Login MCalkins)
Moderator

Posted on Nov 11, 2011, 3:24 PM

Respond to this message   

Return to Index


* LOL

by (Login burger2227)
R

Posted on Nov 10, 2011, 5:12 PM

Respond to this message   

Return to Index


QB64 and older versions of QB

by (Login wulfit)

I haven't used QB for a few years and am more of a novice user. I have some .bas files saved, and I'd like to start using them again but they are under the an older version of QBasic from about 3 years ago - probably the last version. When I googled it, I got a whole lot of stuff about QB64, but I'm not sure how new this is and if my older files would work on it. I have Vista, so it may be ideal for me. Please excuse my lack of knowledge, but any advice would be appreciated. When I've managed to get QB working in the past it has been ideal, so I'd like to use it again. If my older files are not compatible with QB64, I can download hte older verison.

Posted on Nov 1, 2011, 3:37 AM

Respond to this message   

Return to Index


You're in luck...

by (Login qb432l)
R

QB64 will run all of your QBasic code -- and in Vista or W7, too. What's more, it has umpteen new commands, higher screen resolution and any bit-depth of color. You can play .WAV files, display .BMP or .JPG's, and memory is bottomless. It's also very fast.

Galleon, who wrote it, is part of our QBasic community, and I for one, am grateful to him for having created it.

Here's the URL for his site:

http://www.qb64.net/

You can also post questions here or in the QB64 Project forum. Just click Subforums and Chat Room at the top of the page -- it's the 7th one down.

-Bob

Posted on Nov 1, 2011, 9:15 AM

Respond to this message   

Return to Index


QB64 download

by (Login wulfit)

Thanks for that advice - was able to download it and have got it working. It will be a big learning curve but it's worth the effort

Posted on Nov 1, 2011, 11:21 AM

Respond to this message   

Return to Index


download 64 bit qbasic

by (no login)

download it

Posted on Dec 9, 2011, 5:55 AM

Respond to this message   

Return to Index


A further question

by (Login wulfit)

I also have the older version of QB installed, and I remember using DOSBOX to enlarge the QB window a little in Vista. The advice to use QB with DOSBOX is to enter a command which reads something like C MOUNT in the DOSBOX window, but it's not working. I have DOSBOX and the older version of QB installed - can you advise exactly what I need to do to get them working together? I can't remember what I did last time.

Posted on Nov 1, 2011, 12:16 PM

Respond to this message   

Return to Index


Re: A further question

by (Login MCalkins)
Moderator

Welcome to the forum, Mike.

In DOSBox you can type "help" for help. For help on the Mount command, you can type "mount /?".

The syntax of the mount command is:

mount d path

where d is the drive letter you want to use, and path is the actual path of the folder you want to mount. So, for example, my qbasic folder on my computer is c:\q. If I wanted to mount c:\q as drive x: within DOSBox, I would type:

mount x c:\q

Then I could type:

x:

to switch to the newly created x: drive.

I think the main advantage of actual QBASIC over QB64 is that QBASIC is an interpreter, and therefore makes debugging much easier. But otherwise, QB64 works very well.

Regards,
Michael

Posted on Nov 1, 2011, 12:42 PM

Respond to this message   

Return to Index


qbasic and dosbox

by (Login wulfit)

Thanks Michael, your advice is much appreciated. I chose the letter Q to mount and it worked for me. I ended up with a statement "Drive Q is mounted as local directory c:\users\wulfit\qbasic\" where qbasic is the folder containing all my qbasic files. While the DOSBOX window was still open, I entered "q:" and it opened the q drive on DOSBOX.

What is the next step to actually open any of the .bas files in the qbasic folder in the expanded window? Sorry if this seems a bit "basic", but I'm not an expert in this area and I simply don't know.

Posted on Nov 3, 2011, 7:19 AM

Respond to this message   

Return to Index


From that point on, it's business as usual...

by (Login qb432l)
R

Enter QBASIC for QBasic 1.1, or QB for QuickBASIC 4.5 and you'll see the opening screen.

You can also go directly to a specific file, such as:

Q:\>QBASIC Myfile

...in which case QBasic will open with your designated file displayed (upper/lower case are optional, of course).

-Bob

Posted on Nov 3, 2011, 8:35 AM

Respond to this message   

Return to Index


qb45 program w/ 5 modules

by (no login)

If 64 doesn't use the *.mak file to combine modules

with the main module, how is this done in 64?

If you copy them into the main module, shouldn't

you remove some beginning info from each module

Posted on Oct 31, 2011, 8:21 PM

Respond to this message   

Return to Index


QB64 can use $INCLUDE text files with basic code

by (Login burger2227)
R

You can combine all 5 basic code modules into one BAS file as QB64 has no size or memory limitations.

You can INCLUDE CONST, DIM, COMMON, SHARED and DATA statements at the beginning of the main program.

SUBs and FUNCTIONs would be included at the bottom of the main module after all sub-procedures in the main.

If QB64 does not find the text files it should let you know.

QB64 can also work with DLL Libraries using DECLARE LIBRARY

http://qb64.net/wiki/index.php?title=Libraries

Posted on Oct 31, 2011, 9:03 PM

Respond to this message   

Return to Index

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement