View previous topic :: View next topic |
Author |
Message |
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Jul 23, 2003 9:18 am Post subject: #define bug |
|
|
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....
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 |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Jul 23, 2003 1:39 pm Post subject: |
|
|
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 |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jul 23, 2003 7:55 pm Post subject: |
|
|
%%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 |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 23, 2003 8:02 pm Post subject: |
|
|
Garrett I turned off the smilies in the above post for you, it was showing
a face. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Jul 23, 2003 8:07 pm Post subject: |
|
|
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 |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Thu Jul 24, 2003 7:49 pm Post subject: |
|
|
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.
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.
-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 |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jul 24, 2003 8:26 pm Post subject: |
|
|
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? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Jul 25, 2003 2:09 am Post subject: |
|
|
good lateral thinking there garrett
serge _________________
|
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Jul 25, 2003 8:36 am Post subject: |
|
|
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 |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Jul 25, 2003 8:48 am Post subject: |
|
|
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 |
|
|
|