forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help! Illegal variable name.

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Fri Mar 29, 2002 8:27 pm    Post subject: Help! Illegal variable name. Reply with quote

I've been working in my program Protected Tiles Pro, and a few days ago I found that, although the program runs perfectly using the "Run" button in the VDS window, the compiled EXE always returns Error 5 in this line:

Code:
%%LINETOGOTO = @trim(@regread(CURUSER,Software\ProtectedPrograms\PTP\@iniread(Credits,Title)\Labels,%%LABEL))


%%LABEL and @iniread(Credits,Title) aren't null. If the error isn't in this line its somewhere arround it, anyway here you have the whole block:

Code:
:FindLabel
 %%LINETOGOTO = @trim(@regread(CURUSER,Software\ProtectedPrograms\PTP\@iniread(Credits,Title)\Labels,%%LABEL))
 if @null(%%LINETOGOTO)
  warn Error 000-002 Could not find label %%LABEL" - line "%%SCRIPT
  goto Close
 end
 if @not(@numeric(%%LINETOGOTO))
  warn Error 000-002 Could not find label %%LABEL" - line "%%SCRIPT
  goto Close
 end
 LIST SEEK,SCRIPT,%%LINETOGOTO
 %%SCRIPT = @INDEX(SCRIPT)
 %%LABEL =
 goto ComLoop


Also, when error trapping is enabled, it also makes an error under the own error trapping label, it seems that there is something about the above line that makes it impossible for VDS to keep defining new variables. I tried decrease or increase the number of variables being used but without success. Can anyone help me with this? [/code]
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 29, 2002 9:16 pm    Post subject: Reply with quote

I'd try setting the %%LINETOGOTO value manually to see if
it's the var name or the @regread() procedure. If it will work
with the var value set, you might try the following and see
what you get:
__________________________________________________________________________________________________________________________
Code:

INFO TEST @trim(@regread(CURUSER,Software\ProtectedPrograms\PTP\@iniread(Credits,Title)\Labels,%%LABEL))

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Fri Mar 29, 2002 9:20 pm    Post subject: Reply with quote

I had already tried that Mac. I tried everything. THAT works. It returns 3 . In that case, TEST 3 .
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Mar 29, 2002 9:51 pm    Post subject: Reply with quote

So loading the value manually (%%LINETOGOTO = 3) works OK?

Have you tried omitting the @trim() function? You could trim
the var after it gets the @regread() with @trim(%%LINETOGOTO)...

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Sat Mar 30, 2002 1:23 am    Post subject: Reply with quote

The trim function in this case is completely useless and it wasn't there until prakash told me to try it
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Mar 30, 2002 5:46 am    Post subject: Reply with quote

You might try using an IF statement to make sure %%LABEL is valid
and @regread() is numeric before %%LINETOGOTO is assigned...
_______________________________________________________________________________________________________________________________________________________________________________________
Code:

if @both(%%LABEL, @numeric(@regread(CURUSER,Software\ProtectedPrograms\PTP\@iniread(Credits,Title)\Labels,%%LABEL)))
  %%LINETOGOTO = @trim(@regread(CURUSER,Software\ProtectedPrograms\PTP\@iniread(Credits,Title)\Labels,%%LABEL))
else
  INFO Invalid value...
end

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Sat Mar 30, 2002 5:49 pm    Post subject: Reply with quote

Mac, the value returned by @regread IS numeric, it is ALWAYS assigned by the program (before this part) and it must always be numeric. %%LABEL varies, as these commands are run everytime there is a GOTO command in the game script, but in this case, the program freezes in the first time, when %%LABEL is equal to ?Begin which is a label that ALWAYS exists in the game script. The solution for this is not that simple, I tried every possible simple thing.... If you want the whole source code tell me and I'll send it to you (or anyone else who wants to try)
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Mar 30, 2002 6:10 pm    Post subject: Reply with quote

Protected, did you try the snippet of code above?

You said the program runs fine from the IDE, I was just
trying to come up with a reason why it won't run compiled.

One other thing that comes to mind. Since compiled progs
run so much faster, you might try inserting WAIT here and
there to give functions (such as @regread) time to keep up
with the rest of the code.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Sat Mar 30, 2002 6:37 pm    Post subject: Reply with quote

Mac I don't know how could this happen, but the problem is solved!!! Very Happy

I decided to continue programming and forget this for a while. Since this new version of PTP is full screen, I removed the menus and changed the code so it works with hotkeys (vdshot.dll). And when i compiled the program and tried it..... it was running!!!!! Very strange isn't it? Perhaps the error was inside the code that handled the program's menu system (it was a code with + then 300 lines), in fact the program used to process it before the line where the error happened.....
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group