| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sat Feb 20, 2010 7:21 pm Post subject: Variable containing whole command line like $CmdLineRaw |
|
|
Hi,
It might be nice to have a variable containing the whole command line which was passed to the script like $CmdLineRaw in AutoIt3.
Comp. also http://www.autohotkey.com/forum/topic54779.html
Tobias |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
|
| Back to top |
|
 |
fincs
Joined: 05 May 2007 Posts: 1160 Location: Seville, Spain
|
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
|
| Back to top |
|
 |
Guest
|
Posted: Sat Feb 20, 2010 9:19 pm Post subject: |
|
|
Hm my posting here was just to suggest an improvement as, in my point of view, it is much easier when I find a documented function / variable in the help (which is in my point of view perfect for AHK). Doing a DllCall does it as well but ok... that's up to the point of view of the dev
And posted it here as well as I found such a function in the AutoIt and AHK is my prerferred "automating" language  |
|
| Back to top |
|
 |
fincs
Joined: 05 May 2007 Posts: 1160 Location: Seville, Spain
|
Posted: Sun Feb 21, 2010 8:50 pm Post subject: |
|
|
| Tuncay wrote: | | Oh that is good to know. In standard AutoHotkey, should we use the Unicode friendly version also? |
If you want to port your script to Unicode in the future then it'll be easier  _________________ fincs
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list] |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Mon Feb 22, 2010 3:39 am Post subject: |
|
|
FYI, that's one thing that is now covered in my documentation: Script Compatibility - DllCall
Standard (or "mainstream") AutoHotkey is an ANSI build. It also notes where it differs from AutoHotkey_L ANSI builds.
As for the original topic: One of the things under consideration (long ago!) for v2 was replacement of %0% %1% etc. with some built-in variables or a built-in function. For instance, infogulch suggested A_0, A_1, etc., JSLover(?) suggested A_Param1, A_Param2, ...
I think the current issues are obscurity (things like if 0 > 1) and the lack of support for them directly in expressions. If they were replaced with a built-in function, it could return all parameters when the parameter number was omitted:
| Code: | all_args := GetCommandLineArg()
arg_1 := GetCommandLineArg(1)
| Naming may be difficult: do we want clarity or brevity? |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Feb 22, 2010 7:38 am Post subject: |
|
|
| Lexikos wrote: | | ...JSLover(?) suggested A_Param1, A_Param2, ... |
...I have current working (unreleased) code for A_Param1, A_ParamN...but it's not as useful as I'd like (parsing params based on order)...so I plan on writing universal command line getting/parsing code...
| Lexikos wrote: | | Naming may be difficult: do we want clarity or brevity? |
...my working function name is ParamGet()... |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
Posted: Mon Feb 22, 2010 7:08 pm Post subject: |
|
|
| Quote: | | so I plan on writing universal command line getting/parsing code... |
I have made a parser for options, it is not made for the command line. It could parse the command line of some programs also, but that was not the reason why I made it. May be you find it useful or you can rework on the source for that: argp - Argument Options Parser _________________ {1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <-- |
|
| Back to top |
|
 |
MilesAhead
Joined: 21 Jan 2009 Posts: 86
|
Posted: Tue Mar 02, 2010 2:28 am Post subject: |
|
|
| Anonymous wrote: | | Lexikos wrote: | | ...JSLover(?) suggested A_Param1, A_Param2, ... |
...I have current working (unreleased) code for A_Param1, A_ParamN...but it's not as useful as I'd like (parsing params based on order)...so I plan on writing universal command line getting/parsing code...
| Lexikos wrote: | | Naming may be difficult: do we want clarity or brevity? |
...my working function name is ParamGet()... |
If it's up for a vote I favor the old Borland Pascal
ParamStr function where ParamStr(0) is the name of the program itself and ParamStr(1) the first command line arg etc.. ParamCount return the number of args. |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Mar 02, 2010 7:38 pm Post subject: |
|
|
| MilesAhead wrote: | | ...I favor the old Borland Pascal... |
...I know nothing about Borland, but based on DOS or something else (not sure what) I prefer that too. In my current code A_Param0 gets the exe name & A_Param1 is the 1st Param & A_Params is the number of params...param 0 should not be the number of params (like it is in AHK's %0%)... |
|
| Back to top |
|
 |
|