Page 1 of 1

FreeBASIC problems

Posted: Sun Feb 13, 2005 3:09 pm
by RayBritton
Will is it that when i try and compile this code

Code: Select all

RANDOMIZE TIMER / 3

arearetrival:
monum = INT((3 - 1 + 1) * RND + 1)
SELECT CASE area
CASE 0
   GOTO runerror
CASE 1
   IF monum = 1 THEN monfilename$ = "areaone1.mon"
   IF monum = 2 THEN monfilename$ = "areaone2.mon"
   IF monum = 3 THEN monfilename$ = "areaone3.mon"
   GOTO loadmonfile
CASE 2
   IF monum = 1 THEN monfilename$ = "areatwo1.mon"
   IF monum = 2 THEN monfilename$ = "areatwo2.mon"
   IF monum = 3 THEN monfilename$ = "areatwo3.mon"
   GOTO loadmonfile
CASE 3
   IF monum = 1 THEN monfilename$ = "areathr1.mon"
   IF monum = 2 THEN monfilename$ = "areathr2.mon"
   IF monum = 3 THEN monfilename$ = "areathr3.mon"
   GOTO loadmonfile
CASE 4
   IF monum = 1 THEN monfilename$ = "areafor1.mon"
   IF monum = 2 THEN monfilename$ = "areafor2.mon"
   IF monum = 3 THEN monfilename$ = "areafor3.mon"
   GOTO loadmonfile
CASE 5
   IF monum = 1 THEN monfilename$ = "areafiv1.mon"
   IF monum = 2 THEN monfilename$ = "areafiv2.mon"
   IF monum = 3 THEN monfilename$ = "areafiv3.mon"
   GOTO loadmonfile
CASE 6
   IF monum = 1 THEN monfilename$ = "areasix1.mon"
   IF monum = 2 THEN monfilename$ = "areasix2.mon"
   IF monum = 3 THEN monfilename$ = "areasix3.mon"
   GOTO loadmonfile
CASE 7
   IF monum = 1 THEN monfilename$ = "areasev1.mon"
   IF monum = 2 THEN monfilename$ = "areasev2.mon"
   IF monum = 3 THEN monfilename$ = "areasev3.mon"
   GOTO loadmonfile
CASE 8
   IF monum = 1 THEN monfilename$ = "areaeig1.mon"
   IF monum = 2 THEN monfilename$ = "areaeig2.mon"
   IF monum = 3 THEN monfilename$ = "areaeig3.mon"
   GOTO loadmonfile
CASE 9
   IF monum = 1 THEN monfilename$ = "areanin1.mon"
   IF monum = 2 THEN monfilename$ = "areanin2.mon"
   IF monum = 3 THEN monfilename$ = "areanin3.mon"
   GOTO loadmonfile
CASE 10
   IF monum = 1 THEN monfilename$ = "areaten1.mon"
   IF monum = 2 THEN monfilename$ = "areaten2.mon"
   IF monum = 3 THEN monfilename$ = "areaten3.mon"
   GOTO loadmonfile
CASE 11
   IF monum = 1 THEN monfilename$ = "areaele1.mon"
   IF monum = 2 THEN monfilename$ = "areaele2.mon"
   IF monum = 3 THEN monfilename$ = "areaele3.mon"
   GOTO loadmonfile
CASE 12
   IF monum = 1 THEN monfilename$ = "areatwe1.mon"
   IF monum = 2 THEN monfilename$ = "areatwe2.mon"
   IF monum = 3 THEN monfilename$ = "areatwe3.mon"
   GOTO loadmonfile
END SELECT
runerror:
PRINT "No area code was found"
loadmonfile:
PRINT monfilename$
' OPEN monfilename$ FOR INPUT AS #1
' get #1,monhp,monmp,monmag,monstr,mondef,monacl,monmcl,monpic
' close #1

i get this error

Code: Select all

Unkown error 
you didn't save file as .bas (i did)
some library/include header is not linked 
On Line:

Posted: Sun Feb 13, 2005 4:06 pm
by Rattrapmax6
:) Okay, some IDEs you need to type your file like this when you save:

Filename.BAS 'Notice with the ".BAS" at the end..

Others add the .BAS for you, the one I have does.. you must have a older or a version that doesn't, you need to type .BAS yourself.

Now, your not going to see what happens in this file,. at the very end of the whole thing you need to insert SLEEP, this will pause the ending prog until key is pressed, otherwise it will automaticly close..

By looking at this, you got one you have to save and compile every time you run, you need to get one like VonGodric's that has a QuickRun (F5), this is much easier to code with. :wink:

Posted: Sun Feb 13, 2005 4:26 pm
by Z!re
Are you sure you have enabled file extensions in windows XP? If you havent you wont be able to change it to a .BAS file.

It compiles fine for me.



If you're not using an IDE, you need to type:
fbc yourbasfile.bas

You MUST include the .BAS extension.

Posted: Sun Feb 13, 2005 4:38 pm
by Mitth'raw'nuruodo
Ummmm...FB probl, in a QB site!...ramble...ramble....ramble...

Excuseee me for my rambling.... :D

Posted: Sun Feb 13, 2005 5:39 pm
by Guest
i'm using win98
yes i have a .bas extension

Posted: Sun Feb 13, 2005 6:13 pm
by Mitth'raw'nuruodo
I think that person ^ was RayBritton....

Just a thought..... 8)

Hey, I help out when I can :P !

Posted: Sun Feb 13, 2005 6:29 pm
by Z!re
It compiles fine for me, weird..

Are you using VonGodrics IDE?

Try compiling from the commandline. Thats what I did, which worked.





Mitth, got nothing to say that is relevant to the topic, then please, stfu.

Posted: Sun Feb 13, 2005 6:53 pm
by {Nathan}
Mitth'raw'nuruodo wrote:Ummmm...FB probl, in a QB site!...ramble...ramble....ramble...

Excuseee me for my rambling.... :D
If this site hosts a qb/fb mag, why not qb/fb forums?!

Posted: Sun Feb 13, 2005 8:11 pm
by Rattrapmax6
:) It sound like you got a bad IDE, I once had one that wouldn't compile QB gfxs, you may want to look into VonGodric's.. :wink:

Posted: Sun Feb 13, 2005 9:41 pm
by Mitth'raw'nuruodo
Ummm ok Nate but that hasn't happened yet :)

You're really bent up on this IDE aren't you Rattra? :D

:shock: Opps...sorry Z!re I forgot....