JATO Posted December 18, 2005 Share Posted December 18, 2005 The Help file talks alot about the function or command RETURNING either a specific name OR a 0 (zero) How do I see what a function/command returned? Say I use ProcessExist ("somename") According to the Help File.. Return Value Success: Returns the PID of the process. Failure: Returns 0 if process does not exist. How do I view this or check it? -- that's the part I can't find in the Help file. Do I have to assign a variable to the command and then reference the variable, such as $Var = ProcessExist ("somename") MsgBox (0, "test", "$Var") I've used NSIS installer and the Return value is stored in a stack as $0 or $1 -- so you can do a message box display $0 to view the result ~J. Schutzmanwww.alchemistgamer.com Link to comment Share on other sites More sharing options...
Valuater Posted December 18, 2005 Share Posted December 18, 2005 (edited) Do I have to assign a variable to the command and then reference the variable, such asCODE$Var = ProcessExist ("somename")MsgBox (0, "test", "$Var")yesalso...functions can "return" 0 or specific names too8) Edited December 18, 2005 by Valuater Link to comment Share on other sites More sharing options...
ChrisL Posted December 18, 2005 Share Posted December 18, 2005 Right here is a function from one of my scripts, it gets the dir size of a folder. The return value is either the file count $aSize[1] or -1 for failure (i.e the Dir does not exist) To get the information from the function I would use $DirSize = GetCount("C:\MyFolder") When the function is ran it will set the Var $DirSize to either the file count or -1 Func GetCount($Dir) If FileExists($Dir) Then $aSize = DirGetSize($Dir, 1) Return $aSize[1] Else Return -1 EndIf EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Valuater Posted December 18, 2005 Share Posted December 18, 2005 good example chris... i couldn't think of a small exaple like that 8) Link to comment Share on other sites More sharing options...
JATO Posted December 23, 2005 Author Share Posted December 23, 2005 Thanks guys that helped alot ~J. Schutzmanwww.alchemistgamer.com Link to comment Share on other sites More sharing options...
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