Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
quickbasic on windows xp
#21
i copy and pasted that how could have i screwed that up Sad

anyways corrected now
Reply
#22
Thank you, ShadowWolf and Za!re. I have downloaded the fbc.exe Free Basic compiler. I have also downloaded an fbide.exe. When I ran the fbide, I was very happy. When I tried to run QuickBASIC .bas files in fbide.exe, I had problems; not so in QuickBASIC on my MSDO 95 disk! So, I sort of gave up on fbide.exe. I just like to have things work properly, or know enough to fix the problem. With fbide, I am as a child, so, I just go to what I know better. This is why I have been hitting my head against the Internet, in the hopes that I could run .bas and QB .exe programs as I have always been able to, except when I got the new computer with Windows XP on it.

Now, if you can tell me, "Download this fbide.exe, it will allow you to run ALL your QuickBASIC .bas files without a hitch. And, this fbc.exe witll compile your QuickBASIC .bas files that run in the fbide fine, and the .exe files will now run in your Windows XP HE without a hitch, too." Well, that's the time I will give this new-fangled thing another try.

Note, my present fbide.exe is, from its Main Menu Help:
Quote:FBIde v0.3.3, by VonGodric

An editor for FreeBasic Compiler, etc.

As I have not compiled anything in fb, I guess I shouldn't even mention my fbc.exe.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#23
*cough*it's z!re*cough*


You have an old version.
Plus maybe saying what the problems were would help =P


Downloading the bundle makes everything work. Just run the program and it installs all you need. The run fbide.exe and set the compiler path.

http://prdownloads.sourceforge.net/fbide...e?download


Don't give up so easily.

Plus we can't tell you
Quote:"Download this fbide.exe, it will allow you to run ALL your QuickBASIC .bas files without a hitch. And, this fbc.exe witll compile your QuickBASIC .bas files that run in the fbide fine, and the .exe files will now run in your Windows XP HE without a hitch, too."

fbide does not -run- the code. It simply is a IDE for you to work with. You code in it. it compiles the code into an exe. then it runs the exe.

without fbc and the correct compiler path fbide is worthless.
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#24
FB is different than QB in some ways. If you have problems, you might try checking the "keywords.txt" file for changes from QB to FB. If that doesn't help, try the online documentation[1]. It explains in-depth how to use it in FB and it also lists the changes from QB to FB.

[1] - http://www.freebasic.net/wiki/wikka.php?wakka=DocToc
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply
#25
WhiteTiger0990:
Here I go!

I downloaded the compressed file, "ran" it, got a zillion and one files loaded into my computer in C:\Freebasic\, ending up with the ide running. I went to File, went to my A: drive and selected a relatively small and simple program, called "CHASE", a 3KB .bas program, which code I copy below.

This program runs fine in qb.exe (QuickBASIC 4.5), and uses only the default screen, the text screen.

I started FBIde, then clicked on File, Open, looked for "CHASE.bas", found it on my A: drive, double clicked it, and it loaded in the fbide, where I can see it (for what it's worth, I had saved it as a text file). Now, I clicked on RUN, did a "compile and run", it seemed to work, and the (compiled?) program started up. After the first screen, I got, instead of a solid blue background, an alternating white and blue bar one character high, with the screen (program?) frozen! I tried to run the CHASE.exe file directly, by just going to the A: drive and double clicking on it. Same thing! Why? I don't know why. It runs perfectly O.K. in QuickBASIC 4.5. Why not after I compiled it in the fbc.exe that I just now obtained after running the downloaded file, FB_0.13_IDE_0.4.exe ?

Here is the simple program, which was inspired by someone else's posting here, I believe:

Code:
RANDOMIZE TIMER


top:
CLS
PRINT " CHASE, a simple QuickBASIC program, in which a moving rectangle ";
PRINT "is moved until"
PRINT " it touches a fixed rectangle."
PRINT


   'set colors for moving rectangle and fixed rectangle
cmr = 15    'white
cfr = 4 + 8 'bright red

   'begin program
top1:
LOCATE 21, 10
PRINT " Press <Esc> to terminate program, <Enter> to continue"
again1:
k$ = "": WHILE k$ = "": k$ = INKEY$: WEND
IF k$ = CHR$(27) THEN GOTO fin:
IF k$ <> CHR$(13) THEN GOTO again1:

  
   'make screen all blue
BG = 1 'BackGround is blue
FG = 15  'ForeGround is white
COLOR BG, FG
CLS
FOR r = 1 TO 22   'rows
  FOR c = 1 TO 80 'columns
    PRINT CHR$(219);
  NEXT c
  PRINT
NEXT r


   'initial positions:
'moving rectangle
y = INT(RND * 21) + 2'note that y is normally vertical, or rows
x = INT(RND * 80) 'note that x is normally horizontal, or columns
'The syntax for LOCATE is: LOCATE line #, column #, or LOCATE y,x
LOCATE y, x: COLOR cmr: PRINT CHR$(219)
'fixed rectangle
yfixed = INT(RND * 21) + 2
xfixed = INT(RND * 80)
LOCATE yfixed, xfixed: COLOR cfr: PRINT CHR$(219)


   'navigate with the arrow keys
again2:
k$ = "": WHILE k$ = "": k$ = INKEY$: WEND
IF k$ = CHR$(27) THEN SYSTEM
IF LEFT$(k$, 1) <> CHR$(0) THEN GOTO again2: 'arrow key not pressed

LOCATE y, x: COLOR BG: PRINT CHR$(219) 'erase old white rectangle
k$ = RIGHT$(k$, 1)
IF k$ = "H" THEN y = y - 1
IF k$ = "P" THEN y = y + 1
IF k$ = "M" THEN x = x + 1
IF k$ = "K" THEN x = x - 1

'do not allow off limits values
IF x < 1 THEN x = x + 1
IF y < 1 THEN y = y + 1
IF x > 80 THEN x = x - 1
IF y > 22 THEN y = y - 1
'''PRINT x, y 'used for debugging only
IF y = yfixed AND x = xfixed THEN GOTO won:
LOCATE y, x: COLOR cmr: PRINT CHR$(219)
LOCATE 1, 38: PRINT "  ": count = count + 1
LOCATE 1, 38: COLOR 1, 15: PRINT count

GOTO again2:


won:
LOCATE 19, 30: PRINT "Hooray, you won!";
GOTO top1:


'terminate program
fin:
CLS
SYSTEM
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#26
perfectly understandable
You just bumped into one of the small incompatibility issues.
change the
Code:
IF LEFT$(k$, 1) <> CHR$(0)
to
Code:
IF LEFT$(k$, 1) <> CHR$(255)

since FBC uses C stuff (correct me if im wrong) chr$(0) is the null terminator for strings.
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#27
Thank you. I know that you just won't believe me when I say that I had just found that when I got your message alert! So, I now have two CHASE.BAS, one on my A: drive, with CHR$(0), and one on my C:\Freebasic directory, with chr$(255). I will now recompile...

Nope, I still get the blue and white bars! I'll keep reading the keywords.txt file, searching for other possible differences. Arghh! No other way out, I guess.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#28
oh yeah the chr$(255) thing should have fixed the moving. But I don't know about the white and blue bars. I'm on linux =P
I still see the bars But sorry I dont know how to help ^^;; it kinda looks the the chr$(219) is too short)
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#29
CHR$(219) is just a solid rectangle, one character wide and high. It shows up O.K. for the blue rectangle (the moving one), so that would not seem to be a problem, to me. Any other ideas?

I did not find any other commands or statements that I could identify as different in fb from qb.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#30
take the extra print statement out of your for loops.
Code:
FOR r = 1 TO 22    'rows
  FOR c = 1 TO 80 'columns
    PRINT CHR$(219);
  NEXT c
NEXT r
since you've already printed 80 chr$(219)'s, the cursor automatically moves to the next row on the screen.

btw, if you use len(k$) <> 2 then the code is the same in both qb and fb. :wink:
Code:
RANDOMIZE TIMER


top:
CLS
PRINT " CHASE, a simple QuickBASIC program, in which a moving rectangle ";
PRINT "is moved until"
PRINT " it touches a fixed rectangle."
PRINT


   'set colors for moving rectangle and fixed rectangle
cmr = 15    'white
cfr = 4 + 8 'bright red

   'begin program
top1:
LOCATE 21, 10
PRINT " Press <Esc> to terminate program, <Enter> to continue"
again1:
k$ = "": WHILE k$ = "": k$ = INKEY$: WEND
IF k$ = CHR$(27) THEN GOTO fin:
IF k$ <> CHR$(13) THEN GOTO again1:


   'make screen all blue
BG = 1 'BackGround is blue
FG = 15  'ForeGround is white
COLOR BG, FG
CLS
FOR r = 1 TO 22    'rows
  FOR c = 1 TO 80 'columns
    PRINT CHR$(219);
  NEXT c
NEXT r


   'initial positions:
'moving rectangle
y = INT(RND * 21) + 2'note that y is normally vertical, or rows
x = INT(RND * 80) 'note that x is normally horizontal, or columns
'The syntax for LOCATE is: LOCATE line #, column #, or LOCATE y,x
LOCATE y, x: COLOR cmr: PRINT CHR$(219)
'fixed rectangle
yfixed = INT(RND * 21) + 2
xfixed = INT(RND * 80)
LOCATE yfixed, xfixed: COLOR cfr: PRINT CHR$(219)


   'navigate with the arrow keys
again2:
k$ = "": WHILE k$ = "": k$ = INKEY$: WEND
IF k$ = CHR$(27) THEN SYSTEM
IF LEN(k$) <> 2 THEN GOTO again2: 'arrow key not pressed

LOCATE y, x: COLOR BG: PRINT CHR$(219) 'erase old white rectangle
k$ = RIGHT$(k$, 1)
IF k$ = "H" THEN y = y - 1
IF k$ = "P" THEN y = y + 1
IF k$ = "M" THEN x = x + 1
IF k$ = "K" THEN x = x - 1

'do not allow off limits values
IF x < 1 THEN x = x + 1
IF y < 1 THEN y = y + 1
IF x > 80 THEN x = x - 1
IF y > 22 THEN y = y - 1
'''PRINT x, y 'used for debugging only
IF y = yfixed AND x = xfixed THEN GOTO won:
LOCATE y, x: COLOR cmr: PRINT CHR$(219)
LOCATE 1, 38: PRINT "  ": count = count + 1
LOCATE 1, 38: COLOR 1, 15: PRINT count

GOTO again2:


won:
LOCATE 19, 30: PRINT "Hooray, you won!";
GOTO top1:


'terminate program
fin:
CLS
SYSTEM

works the same in both.
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)