compile error

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

compile error

Post by sid6.7 »

i get this msg pointing to this section of my code

237B 012E expression too complex

the section was larger so i broke it down
to this msall part but i am still getting the
error while compling..

when running the program as a BAS its fine

Code: Select all

lanips:

'checking to see if the spinal is particle or meson or NONE

 LET spine$ = ""
 LET spin = 0
 LET spynal = 0

'is the ship BIG enough?

 IF tons > 99999 THEN
       LET spin = INT(RND * 2) + 1
 END IF

RETURN

Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Post by Nodtveidt »

Don't use LET. :D
MystikShadows
Veteran
Posts: 703
Joined: Sun Nov 14, 2004 7:36 am
Contact:

Re: compile error

Post by MystikShadows »

sid6.7 wrote:i get this msg pointing to this section of my code

237B 012E expression too complex

the section was larger so i broke it down
to this msall part but i am still getting the
error while compling..

when running the program as a BAS its fine

Code: Select all

lanips:

'checking to see if the spinal is particle or meson or NONE

 LET spine$ = ""
 LET spin = 0
 LET spynal = 0

'is the ship BIG enough?

 IF tons > 99999 THEN
       LET spin = INT(RND * 2) + 1
 END IF

RETURN

Like Nek said, LET is a useless command provided for backwards compatibility only.

Also, you might want to check the DataTYpe for tons, make sure it's LONG, not integer. since you're comparing against 99999 and integers, in QB, only go up to 32768.

Hope this helps.
When God created light, so too was born, the first Shadow!

MystikShadows

Need hosting? http://www.jc-hosting.net

Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

Post by sid6.7 »

hmmm i removed all the lets, i tried LONG VS INT
i tried making numbers smaller IE...99999 /4 = mini
tons = tons /4

if tons > mini then blah blah blah...


then i even removed EVERYTHING so it was blank

IE...

lanips:

RETURN

and it still gave me that same error....

could i have too many lines of code? 1024...

its so wierd that it works fine as a *.BAS but wont compile
why is that?
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

sid6.7 wrote:hmmm i removed all the lets, i tried LONG VS INT
i tried making numbers smaller IE...99999 /4 = mini
tons = tons /4

if tons > mini then blah blah blah...


then i even removed EVERYTHING so it was blank

IE...

lanips:

RETURN

and it still gave me that same error....

could i have too many lines of code? 1024...

its so wierd that it works fine as a *.BAS but wont compile
why is that?
Are you sure the error is in that part?
I have left this dump.
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

Post by sid6.7 »

here is there error code again
when i run make standalone EXE

Code: Select all

2372 012E   lanips:
            ^expression too complex

0 warnings
1 severe error

42909 bytes available
29734 bytes free
i assumed that since it prints lanips it meant that section?
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

slap me silly....

Post by sid6.7 »

oopsy....rookie mistake

it was in a section ABOVE lanips:

i had a double subtraction going on in a formula

IE

blah = int(blah - blah - - blah - blah)

so the error msg must print out the next line
after the KABOOM?




sigh....
Post Reply