Modify

#804 closed Bug (No Bug)

Strange behavior with simple program

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

When I run the following program, if I change the "for $k=1 to X" so "X" increases, the program takes longer and longer to start up. (Not -> it takes longer to run the program - as of course it would take longer to run the program, but BEFORE the program runs it just sits there for longer and longer. As if AutoIt was running the program completely first to see if there were any errors and THEN it runs it again. Is this normal? Because if I set "X" to 1000, it takes seemingly forever for AutoIt to actually bring up the display and run the program.)

Code:

;
;	A graphics test
;
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

	Opt('MustDeclareVars', 1)
;	AutoItSetOption( "TrayAutoPause", 0 );
;	AutoItSetOption( "WinWaitDelay", 0 );

    dim	$child = GUICreate( "My Draw", 850, 650, 20, 20 )
	dim	$gc1;
	dim	$gc2;
	dim	$gc3;
	dim $i, $j, $k, $l;
	dim $pi = 3.14159265358979;
	dim $d2r = $pi / 180;
	dim	$ir = 50;	Island Radius

    $gc2 = GUICtrlCreateLabel( "Creating", 500, 40, 300, 40, $SS_CENTER )
    GUICtrlSetColor($gc2, 0xaaaaaa)
	GUICtrlSetBkColor($gc2, $GUI_BKCOLOR_TRANSPARENT)

    $gc1 = GUICtrlCreateGraphic( 24, 24, 801, 601 )
    GUICtrlSetBkColor($gc1, 0x000033)
    GUICtrlSetColor($gc1, 0)

    GUICtrlSetColor($gc1, 0xff0000)
	GUICtrlSetGraphic( $gc1, $GUI_GR_COLOR, 0xffff00 );

	for $k=1 to 1
		dim $xc = int( random() * 300 ) + 100;
		dim $yc = int( random() * 300 ) + 100;

		for $i=($xc - 100) to ($xc + 100)
			for $j=($yc - 100) to ($yc + 100)
				dim $r = random();
				dim $ni = $i - $xc;
				dim $nj = $j - $yc;
				if( ($r * $ir) > sqrt(($ni * $ni) + ($nj * $nj)) )then
					$gc3 = GUICtrlSetGraphic( $gc1, $GUI_GR_PIXEL, $i, $j );
					endif
				next
			next
		next

	GUISetState();
	sleep( 5000 );
	exit( 0 );

Attachments (0)

Change History (1)

comment:1 by Valik, on Feb 6, 2009 at 9:07:12 PM

Resolution: No Bug
Status: newclosed

Did you really even think about this code? Just stop and think.

No bug.

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.