| View previous topic :: View next topic |
| Author |
Message |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Mon Aug 12, 2002 7:07 pm Post subject: Params |
|
|
Is it possible to read the parameters by which your program is started?
I mean something like:
format C: \q _________________ phpBB Development Team |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Aug 12, 2002 7:09 pm Post subject: |
|
|
Parameters will be stored in variables %1 .. %9 - %0 is always the full path to the EXE itself.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Mon Aug 12, 2002 7:11 pm Post subject: Stupid me! |
|
|
Tnx Dr. Dread!
Stupid that I forget that  _________________ phpBB Development Team |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Mon Aug 12, 2002 7:14 pm Post subject: |
|
|
You can also use the SHIFT command to be able to access more than 9 parameters.
Each time after using that, the 'virtual' value of "%10" will be moved to %9, the value of %9 to %8 etc.
This could for example be used like this:
| Code: |
%%param = %1
info Parameter 1 = %%param
shift
%%param = %1
info Parameter 2 = %%param
|
Or even automated:
| Code: |
repeat
%%param = %%param%1" "
shift
until @not(%1)
info Parameters:@cr()%%param
|
In order to test parameter functionality without compiling your script, you can use the Run->Command Line menu item.
If parameters from the commandline are enclosed by double quote characters ("),
they will be interpreted as a single parameter by VDS. |
|
| Back to top |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Mon Aug 12, 2002 7:24 pm Post subject: Thanx |
|
|
Thanks for the tip Tommy! _________________ phpBB Development Team |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Aug 12, 2002 10:35 pm Post subject: |
|
|
Speaking of parameters...
I posted a simple utility I use to retrieve command parameters
from Windows programs:
http://www.vdsworld.com/forum/viewtopic.php?p=2929#2929
It captures up to 9 parameters (if ya need more, just use a
loop with the SHIFT command Tommy mentioned).
Cheers, Mac  _________________ 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 |
|
 |
Que Valued Newbie

Joined: 25 Aug 2001 Posts: 38 Location: Newaygo, MICH
|
Posted: Tue Aug 13, 2002 2:47 pm Post subject: |
|
|
Mac, I'm afraid I don't understand what this script does.
I have access to a windows program that was written for our network. It has three edit boxes. Mail Recipient, Subject, & Filename. I tried to run it on a command line with spaces, as follows:
| Code: |
runh mailto.exe someguy subject send.txt
|
but all three params showed up in the first edit box and the command failed. Is this an application for the script you posted  _________________ Que |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Aug 13, 2002 8:22 pm Post subject: |
|
|
Hey Que,
The program I posted is designed to retrieve the
parameters sent to programs by the Windows OS.
For example when a screensaver runs, Windows
sends various parameters to the screensaver,
depending on whether it's calling it at the time
delay, setup, etc. This is in fact how I learned the
parameters listed in the VDS screensavers I've
posted.
Make any sense?
Cheers, Mac  _________________ 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 |
|
 |
Que Valued Newbie

Joined: 25 Aug 2001 Posts: 38 Location: Newaygo, MICH
|
Posted: Wed Aug 14, 2002 12:29 pm Post subject: |
|
|
yep, I understand. I thought it might be something like that, but I wasn't real sure.
Thanks! _________________ Que |
|
| Back to top |
|
 |
|