BananaFredSoft Posted May 8, 2007 Share Posted May 8, 2007 This script always reads "Default". I don't know what is wrong with it, because I have checked and everything is right, the sections and keys are named correctly, and the Ini actually exists with the right data... Any help is greatly appreciated! Sorry for bothering! Global $lr = "" Global $lastsentuser = "" While 1 $lrbefore = $lr $lastsentuser = IniRead($d & ".chat", "Chat", "Last Sent User", "") If $lastsentuser not = $uname Then $lr = IniRead($d & ".chat", "Chat", "Last Sent-", "default") EndIf If $lr not = $lrbefore Then GUICtrlDelete($LastRecived) $LastRecived = GUICtrlCreateLabel($lastsentuser & " says:" & $lr, 8, 36) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $TextPut $LastSent1 = GUICtrlRead($TextPut) IniWrite($d & ".chat", "Chat", "Last Sent-", $LastSent1) IniWrite($d & ".chat", "Chat", "Last Sent User", $uname) GUICtrlDelete($LastSent) $LastSent = GUICtrlCreateLabel("Last Sent:" & $LastSent1, 8, 16, 90, 30) Case $Send $LastSent1 = GUICtrlRead($TextPut) IniWrite($d & ".chat", "Chat", "Last Sent-", $LastSent1) IniWrite($d & ".chat", "Chat", "Last Sent User", $uname) GUICtrlDelete($LastSent) $LastSent = GUICtrlCreateLabel("Last Sent:" & $LastSent1, 8, 16, 90, 30) EndSwitch WEnd -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 8, 2007 Share Posted May 8, 2007 Using 'NOT =' causes problems. Stick with '<>' instead. This also has two debug displays to insert temporarily to see if you are getting expected values: While 1 $lrbefore = $lr $lastsentuser = IniRead($d & ".chat", "Chat", "Last Sent User", "") MsgBox(64, "Debug", "IniRead " & $d & ".chat" & @CRLF & "[Chat]" & @CRLF & "Last Sent User=" & $lastsentuser) If $lastsentuser <> $uname Then $lr = IniRead($d & ".chat", "Chat", "Last Sent-", "default") MsgBox(64, "Debug", "IniRead " & $d & ".chat" & @CRLF & "[Chat]" & @CRLF & "Last Sent-=" & $lr) EndIf If $lr <> $lrbefore Then GUICtrlDelete($LastRecived) $LastRecived = GUICtrlCreateLabel($lastsentuser & " says:" & $lr, 8, 36) EndIf ;... etc. WEnd 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...
BananaFredSoft Posted May 8, 2007 Author Share Posted May 8, 2007 Hmmm... I used <> and it still returns the default, but I think I'm getting closer. I'll report back on whether I succeeded later. Using 'NOT =' causes problems. Stick with '<>' instead. This also has two debug displays to insert temporarily to see if you are getting expected values: While 1 $lrbefore = $lr $lastsentuser = IniRead($d & ".chat", "Chat", "Last Sent User", "") MsgBox(64, "Debug", "IniRead " & $d & ".chat" & @CRLF & "[Chat]" & @CRLF & "Last Sent User=" & $lastsentuser) If $lastsentuser <> $uname Then $lr = IniRead($d & ".chat", "Chat", "Last Sent-", "default") MsgBox(64, "Debug", "IniRead " & $d & ".chat" & @CRLF & "[Chat]" & @CRLF & "Last Sent-=" & $lr) EndIf If $lr <> $lrbefore Then GUICtrlDelete($LastRecived) $LastRecived = GUICtrlCreateLabel($lastsentuser & " says:" & $lr, 8, 36) EndIf ;... etc. WEnd -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat 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