Jump to content

Building a Function with a function inside

Recommended Posts


ok... so I have been having a problem writing a function that also calls on a function. it has been giving me weird errors like "no end function" for func file.au3 and "syntax error" for file.au3. (_FileReadToArray inside of file.au3 is the autoit funciton that my function calls). Is this a common problem for autoit or is it a problem in my logic? am i just dumb? i will add in my logic to look over, but i will take out any local variables.

Thanks guys


Func _PermissionsSet($Who, $What, $location)

Dim $aRecords
Local $permission =  $Who & ':' & $What
Local $filepath = ("variable")
Local $Xcacls = ' /c cscript variable ' & $location & ' /Q /E /G ' & $permission & ' /L ' & $filepath

;;delete file

;;Change File Permissions to user:modify
RunWait(@COMSPEC & $Xcacls)

;;read log file
#include <file.au3>
If Not _FileReadToArray($filepath, $aRecords) Then
    MsgBox(4096, "Error", " Error reading log to Array     error:" & @error)
For $x = 1 To $aRecords[0]
    If StringInStr($aRecords[$x], "error") Then
        MsgBox(0, "Error", 'Record:' & $x & @CRLF & $aRecords[$x])
    ElseIf StringInStr($aRecords[$x], "Complete") Then
        MsgBox(0, "Complete", 'Record:' & $x & @CRLF & $aRecords[$x])
Edited by Larry
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

  • Recently Browsing   0 members

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