Jump to content
Sign in to follow this  
quick_sliver007

GUICTRLSETDATA is not working right.

Recommended Posts

Here is the code.

;;;;;;;;;;;;;;;;;;;;;;;
Func _makelabels()
    Global $labels[42]
    Local $z
    For $c = 1 To 41
        $labels[$z] = GUICtrlCreateLabel("_", $c * 15, 325, 20, 25)
    Next    
EndFunc 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func _SETLETTERS($line)
; (FileReadLine("Wordlist.txt", $line) IS DECRYPTED USING THE Rot13
    Global $Word = Rot13(FileReadLine("Wordlist.txt", $line))
; $Word_len = NUMBER OF LETTERS IN WORD
    Global $Word_len = StringLen($Word)
    Local $c
    Local $d
    For $c = 1 To $Word_len
        GUICtrlSetData($labels[$c],"_"); HELP HERE, IS NOT UPDATING THE LABEL
        For $d = ($Word_len + 1) To 41
            GUICtrlSetData($labels[$d],""); HELP HERE, IS NOT UPDATING THE LABEL
        Next
    Next
; $Word_len IS USED HERE TO DISPLAY THE NUMBER OF LETTERS IN THE WORD
    GUICtrlSetData($Group_WORD, "LETTERS IN WORD" & "(" & $Word_len & ")")
    Return $Word_len
EndFunc  ;==>_SETLETTERS

I marked the problem with the notes, " HELP HERE, IS NOT UPDATING THE LABELS". When the program opens all of the labels read "_" like the makelabels() functions does. I have the function setletters($line) called after the first funtion and the it is not updating the labels. I used a msgbox like this this:

For $c = 1 To $Word_len
        GUICtrlSetData($labels[$c],"_"); HELP HERE, IS NOT UPDATING THE LABEL
        MsgBox(0,GUICtrlRead($labels[$c]),GUICtrlRead($labels[$c]))
        For $d = ($Word_len + 1) To 41
            GUICtrlSetData($labels[$d],""); HELP HERE, IS NOT UPDATING THE LABEL
        MsgBox(0,GUICtrlRead($labels[$d]),GUICtrlRead($labels[$d]))
        Next
    Next

All of the boxes returned 0. I believe what I am doing should be working. What am I doing wrong. Please help.


.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...