regisp Posted December 6, 2005 Posted December 6, 2005 hello the world. i'm trying to find a way to compile a program with command line switch option. Unfortunately, i'm unable to find a way to do it. what i want to do : make a script and compile it. when running the exe, the script run normally when running the exe with -debug option, have more info to know what wrong. hope everything is clear for you guys. thx a lot for your quick help - dont hesitate to contact me for further explanation if needed. ciao
GaryFrost Posted December 6, 2005 Posted December 6, 2005 $debug = 0 If $CmdLine[0] > 0 Then If StringUpper($CmdLine[1]) = "-DEBUG" Then $debug = 1 EndIf EndIf MsgBox(0,"debug","debug = " & $debug) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
MHz Posted December 6, 2005 Posted December 6, 2005 (edited) Test this with a /? parameter. It is a template with Scite4AutoIt3 by typing cmdlineselect and pressing the spacebar.If $Cmdline[0] Then For $i = 1 To $Cmdline[0] Select Case $Cmdline[$i] = '/?' MsgBox(262144, StringTrimRight(@ScriptName, 4) & ' Help', _ 'Switches are:' & @LF _ & @LF & '/extract' _ & @LF & @TAB & 'Extract files to current directory' _ & @LF & '/x' _ & @LF & @TAB & '' _ & @LF & '/x' _ & @LF & @TAB & '' _ & @LF & '/x' _ & @LF & @TAB & '' _ & @LF & '/x' _ & @LF & @TAB & '' _ & @LF & '/x' _ & @LF & @TAB & '') Exit Case $Cmdline[$i] = '/extract' FileInstall('?', @ScriptDir & '\') Exit Case $Cmdline[$i] = '/x' Case $Cmdline[$i] = '/x' Case $Cmdline[$i] = '/x' Case $Cmdline[$i] = '/x' Case $Cmdline[$i] = '/x' Case Else MsgBox(262144, 'Incorrect switch used', 'Command used:' & @LF & $CmdlineRaw _ & @LF & @LF & 'Use /? for the switches available.') Exit EndSelect Next EndIf ; Replace '/x' with desired switches for the above code. Add/Remove as needed.Yah, I know, GAFrost is quick. Edit: Missed a letter. Edited December 6, 2005 by MHz
regisp Posted December 6, 2005 Author Posted December 6, 2005 as always very active community. once again thank you a lot for your quality support
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now