Modify ↓
      
        Opened 14 years ago
Closed 14 years ago
#2147 closed Bug (No Bug)
_GUICtrlListBox_InsertString and random
| Reported by: | ady.sefu2008@… | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.8.1 | Severity: | None | 
| Keywords: | Cc: | 
Description
#include <GUIListBox.au3>
GUICreate("Bug?", 200, 320)
$list=GUICtrlCreateList("", 5, 2, 190, 280)
$button=GUICtrlCreateButton("Do It!", 40, 290, 120, 25)
GUISetState()
While 1
	If GUIGetMsg() = -3 Then
		Exit
	ElseIf GUIGetMsg() = $button Then
		_GUICtrlListBox_InsertString($list,Random(0,100,1))
	EndIf
WEnd
Down work to insert in list a random number.
Attachments (0)
Change History (2)
comment:1 Changed 14 years ago by jchd
comment:2 Changed 14 years ago by Valik
- Resolution set to No Bug
- Status changed from new to closed
Closing this as no bug.  I'll open a new ticket for the crash issue.
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
Note: See
        TracTickets for help on using
        tickets.
    

Isn't this a general help question?
#include <GUIListBox.au3> GUICreate("No Bug!", 200, 320) $list=GUICtrlCreateList("", 5, 2, 190, 280) $button=GUICtrlCreateButton("Do It!", 40, 290, 120, 25) GUISetState() Global $msg While 1 $msg = GUIGetMsg() If $msg = -3 Then Exit ElseIf $msg = $button Then _GUICtrlListBox_InsertString($list, String(Random(0,100,1))) EndIf WEndYou shouldn't call GetMsg() twice and should convert number to string.
Granted that without the String() conversion, AutoIt terminates by crashing, which it shouldn't do.