Jump to content

Using a variable in part of my function definition


mortalic
 Share

Recommended Posts

Func _FileListToArrayByName($f_Directory = @ScriptDir, $e_Extension = "FI*.exe", $f_OutFile = 'C:\LoggedList.txt')oÝ÷ Ù*nÞɲÂäx¡×Á©í¶!jxÖÙyrÚ'ßÛpj{m¢Ê^r'òsOv{a{Mú|ë­~)^½ªâi¹^#§¶Ú.±ëa{§v,µé©v*ÓzjC¸­j^"±«­¢+wöÉrººÛaÇhzÉ÷öÛzkhÂäjëh×6Func _FileListToArrayByName($f_Directory = @ScriptDir, $e_Extension = "FI*.exe", $f_OutFile = @TempDir & '\LoggedList.txt')oÝ÷ ØÚ+v¬jëh×6Dim $filePath = @TempDir
Func _FileListToArrayByName($f_Directory = @ScriptDir, $e_Extension = "FI*.exe", $f_OutFile = $filePath & '\LoggedList.txt')

Obviously I am missing something simple, but hey... I'm still pretty new to this. Care to educate me?

Link to comment
Share on other sites

Try it this way:

_MyTestFunc(1)
_MyTestFunc(2, @ScriptDir)

Func _MyTestFunc($n, $sDir = "")
    If $sDir = "" Then $sDir = @TempDir
    MsgBox(64, "_MyTestFunc", "Folder: " & $n & " = " & $sDir)
EndFunc

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

ok I figured something else out in the interum, I don't need to specify the variable there, I just ledt it "\loggedList.txt"

but down where I am using RunWait() and calling my dos command I add it here

RunWait(@ComSpec & ' /c ' & 'dir ' & '"' & $f_Directory & '\' & $e_Extension & '"' & ' /b /on > ' & @TempDir & $f_OutFile, '', @SW_HIDE)

Thanks for the pointer though.

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...