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 


#define bug

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Bug Reports
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jul 23, 2003 9:18 am    Post subject: #define bug Reply with quote

I made some little scrips which used the #define command. I couldn't use more than 9 variables (%1 to %9), so I thought, maybe I could use the shift command to shift the parameters. But it still can't get the value of parameters after the %9 variable. I think this is a big bug, because I now can't make some scripts in the 'VDS way', by using commas to seperate the values.... Crying or Very sad

Code:
#define function,test

rem This should return something like 10|11|12|13|etc.
info @test(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)

exit

:Test
shift
shift
shift
shift
shift
shift
shift
shift
shift
shift
exit %1 | %2 | %3 | %4 | %5 | %6 | %7 | %8 | %9

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Jul 23, 2003 1:39 pm    Post subject: Reply with quote

It's not a bug. When you call a command or function, the parameters or arguments are assigned to variables %1 to %9. You cannot have more than 9 parameters or arguments. It's the same when passing parameters to a program on the command line. In fact, VDS uses exactly the same code in both cases. The shift command shifts %2 to %1, %3 to %2 etc, %9 to %8 and leaves %9 blank.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Jul 23, 2003 2:17 pm    Post subject: Reply with quote

Isn't it possible to get all parameters with one function, so I can parse them myself?
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jul 23, 2003 7:55 pm    Post subject: Reply with quote

%%CmdLine = %1%2%3%4%5%6%7%8%9

Or

%%CmdLine = %1|%2|%3|%4|%5|%6|%7|%8|%9

-Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Jul 23, 2003 8:02 pm    Post subject: Reply with quote

Garrett I turned off the smilies in the above post for you, it was showing
a face. Wink

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Jul 23, 2003 8:07 pm    Post subject: Reply with quote

Thanks, I didn't notice that after I posted.

-Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Jul 24, 2003 9:43 am    Post subject: Reply with quote

Garrett, that was what I ment, you can't use more than 9 variables when including scripts... Crying or Very sad
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Jul 24, 2003 7:49 pm    Post subject: Reply with quote

Actually, I can cram 200 parameters into just %1 if I wanted. It's in how
you send the parameters from one of your programs to the other. Leaving
a space between them causes VDS to move to the next variable.

If you send your parameters without spaces and use a special character
to seperate them within the command line, you can have as many as
you want.

But you're responsible for sorting out the mess you make. Wink

Run %0 /Name:Garrett/LastName:Hylltun/Age:ReallyOld/Interest:VDS

As far as VDS is concerned, that's just one single parameter above. I'm
sure there's a character limit in place by windows, but I've not run into
yet myself doing the above. I'd suggest limiting each variable to 10
parameters. So you could have up to 90 parameters if you want. More
if you want to push the limits. Wink

-Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jul 24, 2003 8:26 pm    Post subject: Reply with quote

I think what Skit means is that he wants to do his units the "VDS-Style"
way, with commas separating it so it is easy to use, like this:

Code:
BLABLA CREATE,BlaBla1,-1,0,44,44,Another_Parameter,Etc,Etc,Etc


Would it be possible to just add more number variables, like %10 to %50? Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Jul 25, 2003 2:09 am    Post subject: Reply with quote

good lateral thinking there garrett Very Happy

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Jul 25, 2003 8:29 am    Post subject: Reply with quote

Or a function/variable to get all parameters... Wink
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri Jul 25, 2003 8:36 am    Post subject: Reply with quote

If you want to pass a long list of items to process them one at a time probably the best way of doing it is put them into a string list.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Jul 25, 2003 8:48 am    Post subject: Reply with quote

I want to do something like this, so it is in 'real VDS style'...

EXTDIALOG ADD,type,naam,top,left,width,height,value,hint,multi,scroll,tabs.wrap

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Bug Reports 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