Tekkion Posted June 21, 2014 Posted June 21, 2014 (edited) Hi there, following problem: global $test="" func testfunc() $test=true endfunc func anotherfunc() if $test=true then do stuff endif endfunc so if my script is trying to compare the $test variable the script just quits without any error. I don't know what im doing wrong. Basically thats what im trying to do the above testcode is working but my realscript isn't I would post the code of the real script but as I have no idea which part is going wrong I didn't wanted to post the whole thing. Any suggestions or help? Regards Tekkion Edited June 21, 2014 by Tekkion
cageman Posted June 21, 2014 Posted June 21, 2014 did you use a random word generator to come up with this text?
czardas Posted June 21, 2014 Posted June 21, 2014 (edited) If you want a serious response, then post some code that people can actually run. Make sure the code demonstrates the problem you are experiencing and give clear comments on how the functionality differs from the behaviour you expect. Edited June 21, 2014 by czardas operator64 ArrayWorkshop
reb Posted June 21, 2014 Posted June 21, 2014 global $test="" testfunc() anotherfunc() func testfunc() $test=true endfunc func anotherfunc() if $test=true then MsgBox(0,"","WORKS!") endif endfunc This will do it.REB MEASURE TWICE - CUT ONCE
Tekkion Posted June 21, 2014 Author Posted June 21, 2014 (edited) expandcollapse popupglobal $user_created="" global $folder_created="" global $rights_set="" global $share_set="" Local $colUsers, $sTmp="||", $Array[1] = ["user"] $colUsers = ObjGet("WinNT://" & @ComputerName) If IsObj($colUsers) Then $colUsers.Filter = $Array For $objUser In $colUsers $sTmp &= $objUser.Name &"|" Next EndIf GUIDelete($wait) MainWindow() func MainWindow() Dim $avarray Local $hGUI = GUICreate("DKS Freigabe einrichten",300,300) ............................................................................................ if DirGetSize(GUICtrlRead($DKI_Share_folder)) = -1 Then if DirCreate(GUICtrlRead($DKI_Share_folder))=0 Then $folder_created=False Else $folder_created=True EndIf endif .................................................................................................... EndIf endif ;Caseend EndSwitch WEnd GUIDelete() EndFunc ;Mainwindow() func status_windwo() ...........................................declarations.................................................. while 1 if $folder_created=true Then if FileExists(@TempDir&"\user.txt") Then GUICtrlSetImage($led1,"green.jpg") $led1set=true Else GUICtrlSetImage($led1,"red.jpg") $led1set=true EndIf EndIf $msg = GUIGetMsg() switch $msg case $GUI_EVENT_CLOSE ExitLoop EndSwitch wend EndFunc as i said if im trying to compare the variable with a value the script just quits without it runs as expected. Edited June 21, 2014 by Tekkion
Tekkion Posted June 21, 2014 Author Posted June 21, 2014 global $test="" testfunc() anotherfunc() func testfunc() $test=true endfunc func anotherfunc() if $test=true then MsgBox(0,"","WORKS!") endif endfunc This will do it.REB yeah I see i forget to call the funcs but not in my other script sorry for that did you use a random word generator to come up with this text? no
Tekkion Posted June 21, 2014 Author Posted June 21, 2014 (edited) after my bath it seems my brain is working again... I've put the function call above the variable declarations.... anyway Its somekind of weird that the script just quits with no error message... thanks anyway regards Tekkion Edited June 21, 2014 by Tekkion
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