Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Unknown command in select statement

Author
Message
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 4th Aug 2009 09:55
Hi,

I have been working on a game called Hnefatafl for a while now. After my latest update, I suddenly started getting an error saying:

"Unknown command in select statement at line 2569"

This is a puzzel to be because as far as I know, I have not altered the select statements. Further, the line it highlights is just a carrage return; there is no command there at all.

When I delete or move the line, the error still occurs, sometimes at line 2569 and sometimes one or two lines either side.

Here is a link to the program as it stands. It is the file Forum Hnefatafl (not Forum).

Any help you could give me on why this might be happening would be greatly appreciated.

Thanks,

Lucas Tiridath
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 4th Aug 2009 10:28
You just need to add an ENDSELECT right before ENDFUNCTION in the PrepareGameTxtBoxes function.

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 4th Aug 2009 12:49
Thanks Grog, that fixed the problem.

However After I have done that and fixed one other syntax error (forgot to close "), it says that:

"Variable 'to' name is not valid at line 4442."

Now presumably this is because to is a command word for the for... next loop but I know I have not used to as a variable name. Further, the line it highlights is once again a note line which has no code in it so how it can be invalid there I do not know. Any ideas on how I might find out what the problem is as the compiler is not pointing me towards it.

Thanks,

Lucas Tiridath
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 4th Aug 2009 19:19
The line number shown for an error in most editors is typically off by a line or two most of the time. You have to look a few lines above or a few lines below to see if the error is in one of those.

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 4th Aug 2009 19:59
Hmmm. I take your point but I have looked about 60 lines either side and I can't see the error...

Does the compiler go through the code in the order it is written or in ther order it will be run because the line it highlights is near the start of a function. Could it be that the final lines of one of the previous functions could be where the problem lies?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 5th Aug 2009 01:13
Np. Sorry, I figured you'd be ok fixing the other errors yourself.

Did you fix the "'s for all the lines that have "Row without an end quote? (lines 2935, 2944, 2953, and 2962)

The next error is an illegal number of brackets at line 3046. Which is just adding a ) before the last period to make the array work right.

In the outrageous amount of nested IF/ENDIF statements in the RateSquare function remove the ENDIF's on lines 3246, 3270, 3294, 3350, 3374, and 3398. They are extra ENDIF's that shouldn't be there.

And the last one I'll do is line 3617 refers to an array that doesn't exist (I'll let you figure out where to dimentionalize it): AIPieces(c).nPieceID

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 5th Aug 2009 10:29
TYVM Grog!

Sorry about all the repeating errors; its because I always copy and paist similar code so errors spread.

Anyhow thanks once again, it seems to run now and I can get on with working on ironing out the logic errors.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 5th Aug 2009 20:44
Np.

Login to post a reply

Server time is: 2024-11-24 04:21:40
Your offset time is: 2024-11-24 04:21:40