Modify ↓
Opened 14 years ago
Closed 14 years ago
#2147 closed Bug (No Bug)
_GUICtrlListBox_InsertString and random
| Reported by: | 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 by , 14 years ago
comment:2 by , 14 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Closing this as no bug. I'll open a new ticket for the crash issue.
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.