AcidCorps Posted October 13, 2007 Share Posted October 13, 2007 when creating arrays with _ArrayCreate you can simply put $MyArray = _ArrayCreate(Info) how can I make it so that my function would use the same format for naming a variable what I want to do is have a function detect the filename from an input What I have so far is GetFileName($iFullPath) Global = $oFilename = StringTrimLeft($iFullPath,StringInStr($iFullPath,"/",1,-1)) EndFunc Which name $oFilename the filename of the file what I want however is for the function to put the filename of the file into $Filename using the line below: $Filename = GetFileName($iFullPath) So that the output variable can be changed without editing the function everytime note that this is just an example I realize it's almost pointless to create a one line function but I want to learn how to do this anyways Link to comment Share on other sites More sharing options...
McGod Posted October 13, 2007 Share Posted October 13, 2007 $x = GetNum () Func GetNum() Return 7 EndFunc $x now has 7 in it. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Achilles Posted October 13, 2007 Share Posted October 13, 2007 Expanding on what Chip said, "Return" is the word you are looking for. Return will exit the function and return the value directly after the word "Return". So in Chip's example it returns 7. Look in the helpfile for more details about Return. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
AcidCorps Posted October 13, 2007 Author Share Posted October 13, 2007 Thanks, I had a feeling it was something simple like that. 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