Modify

Opened 15 years ago

Closed 15 years ago

#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 Changed 15 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

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

No bug.

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.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.