Jump to content

$Var = MyFunc()


Recommended Posts

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

$x = GetNum ()

Func GetNum()

Return 7

EndFunc

$x now has 7 in it.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...