autoitxp Posted June 27, 2009 Share Posted June 27, 2009 hi this showing data 1 by 1 how to get them like 123 using string method in _log() func _data() Func _data() _log("1") _log("2") _log("3") EndFunc Func _log($read) MsgBox(64, "" , $read) EndFunc Link to comment Share on other sites More sharing options...
Skruge Posted June 27, 2009 Share Posted June 27, 2009 _data() Func _data() _log("1" & "2" & "3") EndFunc Func _log($read) MsgBox(64, "", $read) EndFunc [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
autoitxp Posted June 27, 2009 Author Share Posted June 27, 2009 123 using string method in _log() func /? Link to comment Share on other sites More sharing options...
Skruge Posted June 27, 2009 Share Posted June 27, 2009 /?Do you want _log() to take three different strings and combine them?Or do you want _log to be called three different times, combine the values as you go, and display them at the end? If so, it will need logic to determine when to display the MsgBox.You're going to need to be more specific. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
autoitxp Posted June 27, 2009 Author Share Posted June 27, 2009 (edited) do you want _log to be called three different times, combine the values as you go, and display them at the end? exactly Edited June 27, 2009 by autoitxp Link to comment Share on other sites More sharing options...
DCCD Posted June 27, 2009 Share Posted June 27, 2009 Func _log($read) Do $r= ConsoleWrite($read) Until $r = 1 EndFunc [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
Skruge Posted June 27, 2009 Share Posted June 27, 2009 exactlyYou skipped an important part: "If so, it will need to determine when to display the MsgBox." This will display and reset every third call:_data() Func _data() _log("1") _log("2") _log("3") EndFunc Func _log($read) Global $s_Text, $i_Count $s_Text &= $read $i_Count += 1 If $i_Count >= 3 Then MsgBox(64, "", $s_Text) $i_Count = 0 $s_Text = "" EndIf EndFunc [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Skruge Posted June 27, 2009 Share Posted June 27, 2009 Func _log($read) Do $r= ConsoleWrite($read) Until $r = 1 EndFunc@DCCD: That code will cause an infinite loop if the string is longer or shorter than one character. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Authenticity Posted June 27, 2009 Share Posted June 27, 2009 _data() Func _data() _log("1") _log("2") _log("3") _log("") _log("45") _log("6") _log("") EndFunc Func _log($read) Global $s_Text If $read Then $s_Text &= $read Else MsgBox(0x40, 'Title', $s_Text) $s_Text = '' EndIf EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 27, 2009 Share Posted June 27, 2009 Or maybe use an existing Global: Global $s_Text _data() Func _data() _log("1") _log("2") _log("3") _log("45") _log("6") _log("", True); Display and clear _log("7") _log(); Just display EndFunc Func _log($read = "", $f_Clear = False) If $read <> "" Then $s_Text &= $read & @CRLF Else MsgBox(0x40, 'Title', $s_Text) EndIf If $f_Clear Then $s_Text = "" EndFunc You could also add time stamps to make it a really useful log, but that gets close to just reinventing _FileWriteLog(), which I use extensively in all my maintenance scripts. 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 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