Trying To Create A Cascading Array, But Flickers In Gui Making It Unusable ...

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
roonyrooxcess
Posts: 61
Joined: 20 Nov 2020, 21:29

Trying To Create A Cascading Array, But Flickers In Gui Making It Unusable ...

05 May 2021, 15:29

Hi, I'm trying to cascade an array, basically I've created a basic Array from 1 to 20, & I'm trying to move the entire Array to Array 2 to 20, Array 3 to 20 etc.,

I'm filling in the gaps from the initial basic array, so if the entire Array is moved to Array 5 to 20, i use the values from the basic array 1 to 5 & copy them to the now empty Arrays 1 to 5, as the entire array has been moved to Array 5 to 20.

The script works great.

But it flickers like crazy, atm the entire array is filled all at once as it cascades, I'm not sure how to get the script to update step by step to stop the flickering, instead of the entire array ...

Thanks ...

Code: Select all

#SingleInstance, Force

;Create Initial Array

Data := Object()
i:=39
Loop 20
{
   
  i++
  
      data[A_Index] := i
}

Value := data[5]





x:=0

number:=0
YAxisInc:=12
StatusInc:=1

NumStatusInc:=1

loop
{


;Creates Initial Array In Gui As Guide Left Row

Loop, 20

{

x++			;Increments by - to create 40 to 60
y1:=data[x]

YAxis:=number += YAxisInc ;Increments by 12 to create a gap of 12 between numbers




Gui,Add,Text,x160  y%YAxis%  , %x% %y1%

}









;Create Variables To Show In Gui









;Outerloop Using OuterInc   Cascades The Entire Initial Array From Array 1 To Array 20, Array 2 to Array 20 etc., 

;InnerLoopFill Creates An InnerLoop Using OuterInc To Fill In Gaps Created By Cascading The Initial Array

;If the Entire Initial Array gets displaced From Array 1 to Array 5 The InnerLoopLoop Fills Empty Values In Array 1 to 5 Using Values 1 to 5 From Initial Array



;Outerloop

;Outerloop Using OuterInc   Cascades The Entire Initial Array From Array 1 To Array 20, Array 2 to Array 20 etc., 

OuterInc:=2
FillPreviousInc:=1


Loop 20

{


StartPointFill:=OuterInc-OuterInc +1






;InnerLoop
Datax := Object()

IncIncrease:=OuterInc

Loop 20
{



;InnerLoopFill Creates An InnerLoop Using OuterInc To Fill In Gaps Created By Cascading The Initial Array
;If the Entire Initial Array gets displaced From Array 1 to Array 5 The InnerLoopLoop Fills Empty Values In Array 1 to 5 Using Values 1 to 5 From Initial Array

InnerLoopFill:=0
Loop %OuterInc%
{
InnerLoopFill++

Datax[InnerLoopFill] := data[InnerLoopFill]
}	




;Copies Values From Array data[1] to Datax[2],  data[2] to Datax[3] etc.

Datax[IncIncrease] := data[A_Index]

IncIncrease++
}




;Displays Created Cascade In Gui

x:=0
number:=0
YAxisInc:=12
StatusInc:=1

NumStatusInc:=1


Loop, 20

{

x++			;Increments by - to create 40 to 60
y1:=Datax[x]

YAxis:=number += YAxisInc ;Increments by 12 to create a gap of 12 between numbers




Gui,Add,Text,x360  y%YAxis%  , %x% %y1%


}







Gui, Show,x1609 y186 w500, XGraph 
sleep 1000
OuterInc++
}



}




;msgbox %Value%

;MsgBox, % Min(data*)
;
;MsgBox, % Max(data*) 
Rohwedder
Posts: 7627
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Trying To Create A Cascading Array, But Flickers In Gui Making It Unusable ...

06 May 2021, 01:45

Hallo,
try:

Code: Select all

#SingleInstance, Force
;Create Initial Array
Data := Object()
i:=39
Loop 20
{
	i++
	data[A_Index] := i
}
Value := data[5]
x:=0
number:=0
YAxisInc:=12
StatusInc:=1
NumStatusInc:=1
NotShown := True ;gui has not yet been shown
loop
{
	;Creates Initial Array In Gui As Guide Left Row
	Loop, 20
	{
		x++			;Increments by - to create 40 to 60
		y1:=data[x]
		YAxis:=number += YAxisInc ;Increments by 12 to create a gap of 12 between numbers
		Gui,Add,Text,x160  y%YAxis%, %x% %y1%
	}
	;Create Variables To Show In Gui
	;Outerloop Using OuterInc   Cascades The Entire Initial Array From Array 1 To Array 20, Array 2 to Array 20 etc.,
	;InnerLoopFill Creates An InnerLoop Using OuterInc To Fill In Gaps Created By Cascading The Initial Array
	;If the Entire Initial Array gets displaced From Array 1 to Array 5 The InnerLoopLoop Fills Empty Values In Array 1 to 5 Using Values 1 to 5 From Initial Array
	;Outerloop
	;Outerloop Using OuterInc   Cascades The Entire Initial Array From Array 1 To Array 20, Array 2 to Array 20 etc.,
	OuterInc:=2
	FillPreviousInc:=1
	Loop 20
	{
		StartPointFill:=OuterInc-OuterInc +1
		;InnerLoop
		Datax := Object()
		IncIncrease:=OuterInc
		Loop 20
		{
			;InnerLoopFill Creates An InnerLoop Using OuterInc To Fill In Gaps Created By Cascading The Initial Array
			;If the Entire Initial Array gets displaced From Array 1 to Array 5 The InnerLoopLoop Fills Empty Values In Array 1 to 5 Using Values 1 to 5 From Initial Array
			InnerLoopFill:=0
			Loop %OuterInc%
			{
				InnerLoopFill++
				Datax[InnerLoopFill] := data[InnerLoopFill]
			}
			;Copies Values From Array data[1] to Datax[2],  data[2] to Datax[3] etc.
			Datax[IncIncrease] := data[A_Index]
			IncIncrease++
		}
		;Displays Created Cascade In Gui
		x:=0
		number:=0
		YAxisInc:=12
		StatusInc:=1
		NumStatusInc:=1
		First:=!First++
		Loop, 20
		{
			x++			;Increments by - to create 40 to 60
			y1:=Datax[x]
			YAxis:=number += YAxisInc ;Increments by 12 to create a gap of 12 between numbers
			IF NotShown
				Gui,Add,Text,x360  y%YAxis% vY%YAxis%, %x% %y1%
			Else
				GuiControl,, Y%YAxis%, %x% %y1%
			Sleep, 50
		}
		If NotShown
			Gui, Show,x1609 y186 w500, XGraph,% NotShown := False
		OuterInc++
	}
}
roonyrooxcess
Posts: 61
Joined: 20 Nov 2020, 21:29

Re: Trying To Create A Cascading Array, But Flickers In Gui Making It Unusable ...

06 May 2021, 03:23

For some reason my post took ages to be approved & all my posts need to be approved ...

The script works brilliantly, thanks ...

The only problem with the script atm, 41 to 60 cascades instead of 40 to 60, not that big of a deal, but would be great. The script is pretty increment heavy, & im not sure which increment is which ...

Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: wpulford and 410 guests