quick_sliver007 Posted April 15, 2005 Share Posted April 15, 2005 Here is the code I need help with. Dim $string = FileReadLine("wordlist.txt",3) Dim $stringsplit = StringSplit($string,"") Dim $c Dim $labels[20] For $row = 0 to $stringsplit[0] - 1 For $c = 1 To $stringsplit[0] Dim $row Dim $a = 10 + $row*10 Dim $b = 290 $labels[$row] = GUICtrlCreateLabel($stringsplit[$c], $a, $b, 10, 20) Next Next The string in the file is "abc". It makes 3 labels like I want it to but all of the labels display "c" the last character. I want the 1st label to display first character in the string and the 2nd label to display the 2nd character and the 3rd label to display the 3rd charactor and so on. If anyone can help me I will be very thankful. . Link to comment Share on other sites More sharing options...
steveR Posted April 15, 2005 Share Posted April 15, 2005 #include <guiconstants.au3> GUICreate("") $str = "abcdefg" $array = StringSplit($str,"") For $c = 1 to $array[0] GUICtrlCreateLabel($array[$c], $c * 20, 10, 20) Next GUISetState() Do $msg = GUIGetMsg() sleep(10) until $msg = $GUI_EVENT_CLOSE AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
quick_sliver007 Posted April 15, 2005 Author Share Posted April 15, 2005 #include <guiconstants.au3> GUICreate("") $str = "abcdefg" $array = StringSplit($str,"") For $c = 1 to $array[0] GUICtrlCreateLabel($array[$c], $c * 20, 10, 20) Next GUISetState() Do $msg = GUIGetMsg() sleep(10) until $msg = $GUI_EVENT_CLOSE<{POST_SNAPBACK}>Thank you very much for helping me. Your code helped alot.Here is what I came up with from it $string = FileReadLine("wordlist.txt",3) $stringsplit = StringSplit($string,"") Dim $labels[20] For $c = 1 To $stringsplit[0] $labels[$c] = GUICtrlCreateLabel($stringsplit[$c], $c * 10, 290, 10, 20)Thank you again. . Link to comment Share on other sites More sharing options...
steveR Posted April 15, 2005 Share Posted April 15, 2005 (edited) You got it! Opps i see i forgot a param in createLabel. Still works tho. Edited April 15, 2005 by steveR AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. 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