Search the Community
Showing results for tags 'arguments'.
-
Im creating a tab Global $Tab1 = GUICtrlCreateTab(30, 30, 600, 420, $TCS_BUTTONS, -1) And what we see in the function reference: https://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateTab.htm GUICtrlCreateTab ( left, top [, width [, height [, style = -1 [, exStyle = -1]]]] ) ok in 5 arg I got $TCS_BUTTONS But How can I use multiple args like this below Global $Tab1 = GUICtrlCreateTab(30, 30, 600, 420, [$TCS_BUTTONS, $TCS_MULTILINE], -1)
-
Hello all! I'm trying to make a little script that sends a message over TCP. An example payload would be: MY_PAYLOAD#<ATTRS><ATTR><NAME>MAILSERVER</NAME><OPERATION>set_value(ServiceStatus)</OPERATION><VALUE><![CDATA["Not Running"]]></VALUE><TIMESTAMP>1349297031</TIMESTAMP></ATTR></ATTRS>Note how the payload contains special characters, and how the CDATA contains a SPACE (i.e. "Not Running") My compiled AU3 script expects exactly two command line arguments: 1) destination server/port expressed as 127.0.0.1:80 2) the payload I want to send to my server application (which may have multiple ATTRs, this example only has one ATTR) MyApp.exe 127.0.0.1:80 "MY_PAYLOAD#<ATTRS><ATTR><NAME>MAILSERVER</NAME><OPERATION>set_value(ServiceStatus)</OPERATION><VALUE><![CDATA["Not Running"]]></VALUE><TIMESTAMP>1349297031</TIMESTAMP></ATTR></ATTRS>" My problems (plural) are with parsing of the second argument: 1) If I don't wrap second argument in double-quotes, then Windows bails out before even launching EXE with "< was unexpected at this time" 2) If I DO wrap second argument in double-quotes, then two problems can arise when my EXE parses the arguments: aa) The double-quotes are stripped from the CDATA value. ["Running"] is stored in the array as [Running] bb) If CDATA value DOES have a space, such as ["Not Running"], then I get an extra unwanted $CmdLine[3] because the SPACE between Not and Running is treated as a separator. My second argument is thus split into two separate arguments, [2] and [3] instead of being treated as one arg stored in [2] cc) Additionally, my script exits because it has an "IF $CmdLine[0] <>2 THEN Exit (1)" to validate the command line args. I've tried launching the EXE with the second argument wrapped and escaped in a multitude of ways. Double double-quotes, triple double-quotes, single-quotes on the outside with double-quotes inside (i.e. '"ETC"'), starting the second arg with a caret (i.e. ^"ETC") and one of three things happens: 1) "< was unexpected at this time" 2) my CDATA value is stripped of its double-quotes 3) my payload argument gets split at the space in the CDATA value and the script bails out due to the unexpected 3rd argument. Any ideas? How can I preserve the second argument literally, including all special characters, quotes and spaces? I tried adding some string manipulation code to grab the 2nd argument from $CmdLineRaw and it works (preserves the "Not Running" with quotes), but my number of arguments is still 3 instead of 2 if there is a space in the CDATA value. Any assistance would be greatly appreciated!
-
I need to write a code in which I am reading a text file which is of .vbs format and in that a line contains function signature like below Function CreateEnvironmentVariable($sType, $sName, $sValue, $bOverwrite) If the string is in above format, then I need to check number of arguments in it. For in above case it should return 4. Can anyone help me on this.
-
The best example is MouseClick, where you have MouseClick($Button, [$x, $y, [..........]]) Where if X is set, Y must be set too. I do know how to make it so that X and Y are optional, but I am not sure how to get Y mandatory if X is set. I did check the help, but didn't see anything there. Thanks in advance
-
I Compile this: #include <Array.au3> #include <WinAPIShPath.au3> Local $aData = _WinAPI_CommandLineToArgv('"a b" c d') _ArrayDisplay($aData, '_WinAPI_CommandLineToArgv') Pass commandline arguments with cmd and I get this: Thanks in advance
- 4 replies
-
- commandline
- arguments
-
(and 1 more)
Tagged with: