Author |
Message |
Arne Rossiu #1 / 20
|
 QB 4.5 - Expression too complex
Hi, I have an error in QB 4.5 when I'm trying to compile my program. I never had this error before. The Screen looks like this: ------------------------------------------------------------------------- BC C:\QB\DCF.BAS/O/T/C:512; [...] 068A 01EA IF Reserve = 1 THEN PRINT "aktiv " ELSE PRINT "inaktiv" ^ Expression too complex [...] ------------------------------------------------------------------------- What will I have to do to not get this error anymore? Might changing of the compiler Options help or will I have to change anything in the Program? Thanks, Arne (Germany)
|
Wed, 19 Jan 2005 16:29:01 GMT |
|
 |
B #2 / 20
|
 QB 4.5 - Expression too complex
Quote: >Hi, >I have an error in QB 4.5 when I'm trying to compile my program. I never had >this error before. The Screen looks like this: >------------------------------------------------------------------------- >BC C:\QB\DCF.BAS/O/T/C:512; >[...] > 068A 01EA IF Reserve = 1 THEN PRINT "aktiv " ELSE PRINT "inaktiv" > ^ Expression too complex >[...] >------------------------------------------------------------------------- >What will I have to do to not get this error anymore? Might changing of the >compiler Options help or will I have to change anything in the Program?
What type is 'Reserve'? If it is a simple datatype, I can't see anything complex here, but is it a function?
|
Wed, 19 Jan 2005 22:04:06 GMT |
|
 |
Arne Rossiu #3 / 20
|
 QB 4.5 - Expression too complex
Quote: > > 068A 01EA IF Reserve = 1 THEN PRINT "aktiv " ELSE PRINT "inaktiv" > What type is 'Reserve'? If it is a simple datatype, I can't see > anything complex here, but is it a function?
Reserve is a Standard Variable, not defined. the Programm contains no DEFxxx instructions - so it's a single, Symbol "!"?
|
Wed, 19 Jan 2005 23:05:08 GMT |
|
 |
Al Lawren #4 / 20
|
 QB 4.5 - Expression too complex
Quote:
>> > 068A 01EA IF Reserve = 1 THEN PRINT "aktiv " ELSE PRINT "inaktiv" >> What type is 'Reserve'? If it is a simple datatype, I can't see >> anything complex here, but is it a function? >Reserve is a Standard Variable, not defined. the Programm contains no DEFxxx >instructions - so it's a single, Symbol "!"?
I just tried the expression you were attempting to compile and it compiled just fine for me.
|
Wed, 19 Jan 2005 23:14:21 GMT |
|
 |
Arne Rossiu #5 / 20
|
 QB 4.5 - Expression too complex
Quote: > I just tried the expression you were attempting to compile and it > compiled just fine for me.
Try compiling the whole program http://people.freenet.de/Elektronikseite/dcf.bas (don't run it - it might hang up if there is no DCF receiver connected!)
|
Wed, 19 Jan 2005 23:46:12 GMT |
|
 |
Greg Neil #6 / 20
|
 QB 4.5 - Expression too complex
Quote: > > I just tried the expression you were attempting to compile and it > > compiled just fine for me. > Try compiling the whole program > http://people.freenet.de/Elektronikseite/dcf.bas > (don't run it - it might hang up if there is no DCF receiver connected!)
Compiles fine with powerbasic, provided the variable "Min" is changed to something else (min is a reserved word). Some BASICs will give the "expression too complex" error due to a problem it encounters on a prior line. I note that a line previous to the line in question is inordinately long. Try breaking it up into a few, smaller lines and see if your compiler isn't happier.
|
Thu, 20 Jan 2005 00:02:47 GMT |
|
 |
Arne Rossiu #7 / 20
|
 QB 4.5 - Expression too complex
Quote: > Some BASICs will give the "expression too complex" error > due to a problem it encounters on a prior line. I note > that a line previous to the line in question is inordinately > long. Try breaking it up into a few, smaller lines and see > if your compiler isn't happier.
Just tried it, works fine! Thanks! Where is the limit, 127 Char/line? - Arne
|
Thu, 20 Jan 2005 00:51:52 GMT |
|
 |
Brad Kunke #8 / 20
|
 QB 4.5 - Expression too complex
Quote: > > I just tried the expression you were attempting to compile and it > > compiled just fine for me. > Try compiling the whole program > http://people.freenet.de/Elektronikseite/dcf.bas > (don't run it - it might hang up if there is no DCF receiver connected!)
|
Thu, 20 Jan 2005 01:06:16 GMT |
|
 |
Brad Kunke #9 / 20
|
 QB 4.5 - Expression too complex
I tried it and got the same error using Basic PDS 7.1. I think the error is really 2 lines above where ParDat is assigned. Try something like: ParDat = 0 FOR I = 36 TO 57 ParDat = ParDat + D(I) NEXT HTH, Brad Kunkel www.ibisoftware.com
Quote: > > I just tried the expression you were attempting to compile and it > > compiled just fine for me. > Try compiling the whole program > http://people.freenet.de/Elektronikseite/dcf.bas > (don't run it - it might hang up if there is no DCF receiver connected!)
|
Thu, 20 Jan 2005 01:09:11 GMT |
|
 |
Greg Neil #10 / 20
|
 QB 4.5 - Expression too complex
Quote: > > Some BASICs will give the "expression too complex" error > > due to a problem it encounters on a prior line. I note > > that a line previous to the line in question is inordinately > > long. Try breaking it up into a few, smaller lines and see > > if your compiler isn't happier. > Just tried it, works fine! Thanks! > Where is the limit, 127 Char/line?
I'm not sure. My rule of thumb has always been, if it runs more than a few characters beyond the margin, break the line. I also noticed that the line in question forms a sum of consecutive elements of an array. Did you consider replacing the explicit sum with a for..next loop?
|
Thu, 20 Jan 2005 01:04:20 GMT |
|
 |
Arne Rossiu #11 / 20
|
 QB 4.5 - Expression too complex
Quote: > I also noticed that the line in question forms a sum of > consecutive elements of an array. Did you consider > replacing the explicit sum with a for..next loop?
No! But that is a good idea - i'll think about using for-next loop for the Parity Checksum Calculations. This might make the code much shorter. - Arne
|
Thu, 20 Jan 2005 02:22:35 GMT |
|
 |
Arne Rossiu #12 / 20
|
 QB 4.5 - Expression too complex
Quote: > I tried it and got the same error using Basic PDS 7.1. I think the > error is really 2 lines above where ParDat is assigned.
Greg Neill wrote that earlier - you should read the whole thread befor answering! Quote: > Try > something like: > ParDat = 0 > FOR I = 36 TO 57 > ParDat = ParDat + D(I) > NEXT
I'll think about it. Actually, I have something like this: ParDat = D(36) + [...] + D(45) ParDat = ParDat + D (46) + [...]+ D (57) and it works fine. - Arne
|
Thu, 20 Jan 2005 02:24:45 GMT |
|
 |
Brad Kunke #13 / 20
|
 QB 4.5 - Expression too complex
His answer wasn't there when I wrote mine. There's a time lag in receiving newsgroup updates (at least with my ISP). Brad Kunkel www.ibisoftware.com
Quote: > > I tried it and got the same error using Basic PDS 7.1. I think the > > error is really 2 lines above where ParDat is assigned. > Greg Neill wrote that earlier - you should read the whole thread befor > answering! > > Try > > something like: > > ParDat = 0 > > FOR I = 36 TO 57 > > ParDat = ParDat + D(I) > > NEXT > I'll think about it. Actually, I have something like this: > ParDat = D(36) + [...] + D(45) > ParDat = ParDat + D (46) + [...]+ D (57) > and it works fine. > - Arne
|
Thu, 20 Jan 2005 09:10:00 GMT |
|
 |
Arne Rossiu #14 / 20
|
 QB 4.5 - Expression too complex
Quote: > His answer wasn't there when I wrote mine. There's a time lag in > receiving newsgroup updates (at least with my ISP).
Sorry, I didn't know that - my provider (T-Online) only needs a few seconds to update the NG, at least with my postings.
|
Thu, 20 Jan 2005 19:51:58 GMT |
|
 |
Michael A. Cle #15 / 20
|
 QB 4.5 - Expression too complex
Quote: > Hi, > I have an error in QB 4.5 when I'm trying to compile my program. I never had > this error before. The Screen looks like this: > ------------------------------------------------------------------------- > BC C:\QB\DCF.BAS/O/T/C:512; > [...] > 068A 01EA IF Reserve = 1 THEN PRINT "aktiv " ELSE PRINT "inaktiv" > ^ Expression too complex > [...] > -------------------------------------------------------------------------
Is that all on one line? Try breaking it up like this: IF Reserve = 1 THEN PRINT "aktiv " ELSE PRINT "inaktiv" ENDIF And don't forget the ENDIF at the end...
|
Thu, 20 Jan 2005 14:16:11 GMT |
|
|