1,105,363 Community Members

Syntax error (memory issue??)

Member Avatar
debronkart
Newbie Poster
5 posts since Jul 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

[Somehow I posted this Friday in the VB456 forum...sheesh, you'd think after 15 years of foruming, I'd do better than THAT... well, let's try again here.]

I confess that I'm very very rusty with this. Years ago I programmed a QB45 app for a client, and have never done anything since. Today we found a bug and I've found it in the source but I can't get the (unchanged) code to start in QB45 under XP; I get "Syntax Error" when I do Alt-R-Restart. (I had "out of memory" errors but other msgs on this wonderful forum got me past that.)

The Syntax Error msg arises right near the start of my .BI file:

DEFINT A-Z

TYPE lineparams
ID AS STRING * 2
Ft AS INTEGER
St AS INTEGER
Sz AS SINGLE
EC AS INTEGER
SW AS SINGLE
CS AS INTEGER
WS AS INTEGER
CD AS INTEGER
On AS INTEGER

[17 more items follow in the TYPE definition]
END TYPE

I'm suspicious of the word "On" as a possible error cause, but it used to work...

I know such errors can be misleading - could be caused by all kinds of other things, which can later lead to the error that I actually see.

I'm so rusty, I'll even list some primitive things about the project in case I'm overlooking something trivial:
--5 .BAS files
--a .BI and .MAK file (the .MAK is what I'm opening in the UI)
--total 256,438 bytes
Paths are set to C:\QB45, and .BAS

btw, in this case the change I want to make is so trivial that I can edit it into the .BAS file and compile manually, but I've lost all documentation about how to use BC. Is there an online QB45 manual or can you remind me how?

What can I do? Thanks in advance -
Dave

BinaryMayhem
Junior Poster
173 posts since Jun 2004
Reputation Points: 2 [?]
Q&As Helped to Solve: 10 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

welp, I dunno if you solved the problem or not. its now like a month later... but the syntax error is deff the line "on as integer".
ON is a QB reserved word. it always has been. if you change the variable decleration from ON to something like varON then your error will be gone.
some reserved words that require ON:
ON KEY, ON UEVENT, ON STRIG, ON PLAY, ON OPEN, ON ERROR, ON TIMER.

Member Avatar
debronkart
Newbie Poster
5 posts since Jul 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I figured it was ON, but for the life of me I can't figure out why it worked for several years before. (Scratching head.)

As it happens, the project faded momentarily and now will be a good time for it to come back to life. Thanks!

Member Avatar
debronkart
Newbie Poster
5 posts since Jul 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

welp, I dunno if you solved the problem or not. its now like a month later... but the syntax error is deff the line "on as integer".
ON is a QB reserved word. it always has been. if you change the variable decleration from ON to something like varON then your error will be gone.
some reserved words that require ON:
ON KEY, ON UEVENT, ON STRIG, ON PLAY, ON OPEN, ON ERROR, ON TIMER.

Thanks again for this suggestion. I changed all .On as you suggest, and ran into a complaint about a definition...
DECLARE SUB HandlePix (Arg$, Params as LineParams, BoxWidOnly!, PSx@)

Alt-R-R highlighted the "@)" and said "Expected: , or )". I changed it to "PSx as LONG" and the complaint stopped.

But now when I try to open my .MAK file, I get "out of memory. BOY do I wish I had a better memory, or better records of how I used to do this!

I'm running XP Pro; I set my PIF memory settings:
Total memory: Auto
Initial env: Auto
EMS: None
XMS: Auto (used HMA)
DPMI: Auto

Total size of all .BAS files +.BI = 257,055 bytes.

I'm off to do more digging on my own but if anyone has the quick dope-slap fix, let me know -

Dave

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article