lyledg 0 Posted December 4, 2004 Share Posted December 4, 2004 Guys I am trying to write a few log files based on if name fields are populated. The current code is: expandcollapse popup$Save = GUICtrlCreateButton ("Save Log", 620, 460, 60, 25) GLOBAL $Job = GUICtrlCreateInput ( "", 40, 40, 300, 18) GLOBAL $SecJob = GUICtrlCreateInput ( "", 40, 125, 300, 18) GLOBAL $ThdJob = GUICtrlCreateInput ( "", 40, 215, 300, 18) $logfile = ($Logpath1 & (GUIread($Job)) & '.log') $SecSrcandDstlogfile = ($Logpath1 & (GUIread($SecJob)) & '.log') $ThdSrcandDstlogfile = ($Logpath1 & (GUIread($ThdJob)) & '.log') $Jobchktext = GuiRead($Job) <> "" $SecJobchktext = GuiRead($SecJob) <> "" $ThdJobchktext = GuiRead($ThdJob) <> "" While 1 If $msg = $Save Then If $Jobchktext = 1 Then FileWriteline($logfile, "") MsgBox(262208,"Log Saved","Log file saved to " & $Logfile) Return Endif If $SecJobchktext = 1 Then FileWriteline($SecSrcandDstlogfile, "") MsgBox(262208,"Log Saved","Log file saved to " & $SecSrcandDstlogfile) Return Endif If $ThdJobchktext = 1 Then FileWriteline($ThdSrcandDstlogfile, "") MsgBox(262208,"Log Saved","Log file saved to " & $ThdSrcandDstlogfile) Return Endif Else Exitloop EndIf Wend The code executes but only writes the first log file and NOT the rest...what am I doing wrong here? Should I be using a FOR...NEXT loop here instead? I am wanting th write a log file for each Job name field if it is populated with text.. Any guidance would be appreciated... Cheers Link to post Share on other sites
ezzetabi 4 Posted December 4, 2004 Share Posted December 4, 2004 as is now it seems that will make the log if $Job, $SecJob or $ThdJob are '1' not just if they are fill in. Maybe you meant If $Jobchktext <> '' Then Link to post Share on other sites
lyledg 0 Posted December 4, 2004 Author Share Posted December 4, 2004 Thanks ezzetabi, I found the error and re-wrote the code.. Link to post Share on other sites
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