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 by jchd, 14 years ago

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
WEnd

You 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.

comment:2 by Valik, 14 years ago

Resolution: No Bug
Status: newclosed

Closing this as no bug. I'll open a new ticket for the crash issue.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.