catstwespos Posted December 20, 2006 Share Posted December 20, 2006 (edited) hey, 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 -tom 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 FileDelete($filepath) ;;Change File Permissions to user:modify RunWait(@COMSPEC & $Xcacls) sleep(1000) ;;read log file #include <file.au3> If Not _FileReadToArray($filepath, $aRecords) Then MsgBox(4096, "Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 To $aRecords[0] If StringInStr($aRecords[$x], "error") Then MsgBox(0, "Error", 'Record:' & $x & @CRLF & $aRecords[$x]) ExitLoop ElseIf StringInStr($aRecords[$x], "Complete") Then MsgBox(0, "Complete", 'Record:' & $x & @CRLF & $aRecords[$x]) ExitLoop EndIf Next EndFunc Edited December 20, 2006 by Larry Link to comment Share on other sites More sharing options...
catstwespos Posted December 20, 2006 Author Share Posted December 20, 2006 the syntax error that its giving me now is: C:\PROGRA~1\AutoIt3\Include\file.au3(25,1) : ERROR: syntax error Func ^ Link to comment Share on other sites More sharing options...
catstwespos Posted December 20, 2006 Author Share Posted December 20, 2006 when i take out the #include <file.au3> i get an error of: : ERROR: _FileReadToArray(): undefined function. If Not _FileReadToArray($filepath, $aRecords) Link to comment Share on other sites More sharing options...
catstwespos Posted December 20, 2006 Author Share Posted December 20, 2006 wait, it kind of worked...... now its just my own logic errors! Thanks Larry 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