FreeBASIC problems: Using PUT for graphics.
FreeBASIC problems: Using PUT for graphics.
Okay guys, I'm using FBIde to compile and run my program, however, for some reason, it has trouble with this command:
PUT (TileX%, TileY%), TileSet(TilePos%), PSET
It basically refuses to accept TileSet(TilePos%) as a vaild statement. It doesn't want to compile becasue of the (TilePos%) part, which, of course, is where I'm pointing PUT to the array index start point.
...
Gha, that was a lousy sentence... anyway, I hope you guys know what I mean. So, my question is, why isn't this recognized as a valid statement? ...I never had a problem using variables for the image index start position in QB, so why is it a problem in FB? ...or is it just the FBIde which causes the problem?
I guess, I'm gonna try compiling my code through a command line, and see what happens... but other than that, does anyone have an ideas why it won't let me run my code? (Note: that is the only problem... everything else checks out fine)
EDIT: Tried compiling at a command line, I still get the same problem. So, I'm stuck... anyone? Some help would be greatly appreciated.
EDIT2: Okay, I've got it figured out... looks like I forgot to declare some variables there. I'll post here again, if I have more problems, heh.
PUT (TileX%, TileY%), TileSet(TilePos%), PSET
It basically refuses to accept TileSet(TilePos%) as a vaild statement. It doesn't want to compile becasue of the (TilePos%) part, which, of course, is where I'm pointing PUT to the array index start point.
...
Gha, that was a lousy sentence... anyway, I hope you guys know what I mean. So, my question is, why isn't this recognized as a valid statement? ...I never had a problem using variables for the image index start position in QB, so why is it a problem in FB? ...or is it just the FBIde which causes the problem?
I guess, I'm gonna try compiling my code through a command line, and see what happens... but other than that, does anyone have an ideas why it won't let me run my code? (Note: that is the only problem... everything else checks out fine)
EDIT: Tried compiling at a command line, I still get the same problem. So, I'm stuck... anyone? Some help would be greatly appreciated.
EDIT2: Okay, I've got it figured out... looks like I forgot to declare some variables there. I'll post here again, if I have more problems, heh.
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Hey Darkdread! Glad to see you (partly) back. Good that you seemed to have fixed your problem. Yeah, i figured it was a variable problem. It's a freebasic problem, not a FBIDE. FBIDE actually will not cause any problems alone, since all the error checking is done by the compiler itself, or something like that. It's by far best that you dimmension your variables... there are several changes i noticed while porting some code...
-In qbasic, you can have array() AND also have a variable called array. However, you cannot do this with freebasic.
-make sure your subs are declared as a type of variable... initial variable is an integer, and if you try to plug a variable that is, say a single, into the sub that accepts an integer, your code will choke.
-In qbasic, you can have array() AND also have a variable called array. However, you cannot do this with freebasic.
-make sure your subs are declared as a type of variable... initial variable is an integer, and if you try to plug a variable that is, say a single, into the sub that accepts an integer, your code will choke.
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Meaning that I've seen game code where an error trap was used to run functions when PUT was used out-of-bounds. Such games wouldn't work in FB because of the error being gone now. I can't think of any specific examples of this being done and it's quite rare to see in the first place but it's been done before...Rattrapmax6 wrote: Portibility probs, how do you figure that? no, what do you mean by that?
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact:
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
- Mitth'raw'nuruodo
- Veteran
- Posts: 839
- Joined: Sat Jan 22, 2005 11:04 am
- Location: Eastern Coast of US
- Contact: