AutoHotkey Community

It is currently May 26th, 2012, 2:19 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Multiple variable change
PostPosted: January 17th, 2009, 11:00 am 
Offline

Joined: June 16th, 2007, 3:23 am
Posts: 280
My variable stay the same (they should be different)
the variable nom no (no is the increment)
the variable cas np (np is the increment)
They just appear on the tooltip as the same number, how can I the first one show different value than the 2nd on the next run?

Code:
no=0
np=0
de:
tooltip, Ca =%nom%%no1% Nombre=%cas%%np1% `n Casulty =%nom%%no2% Cas=%cas%%np2%

no++ ;ces 2 variable des cas doivent être incrémenté ici après le tooltip
np++ ;ces 2 variable des cas doivent être incrémenté ici après le tooltip
gosub, Cas

goto de

Cas:
inputbox, nom,, Enter nom
inputbox, cas,, Enter nom
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2009, 1:01 pm 
Offline

Joined: July 31st, 2008, 10:27 pm
Posts: 336
Is this what you want?

Code:
no=0
;np=0
de:
tooltip, Ca=%nom1% Nombre=%cas1% `n Casulty=%nom2% Cas=%cas2%

no++ ;ces 2 variable des cas doivent être incrémenté ici après le tooltip
;np++ ;ces 2 variable des cas doivent être incrémenté ici après le tooltip
gosub, Cas

goto de

Cas:
inputbox, nom%no%,, Enter nom
inputbox, cas%no%,, Enter nom
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2009, 3:48 pm 
Offline

Joined: June 16th, 2007, 3:23 am
Posts: 280
Morpheus wrote:
Is this what you want?

Code:
no=0
;np=0
de:
tooltip, Ca=%nom1% Nombre=%cas1% `n Casulty=%nom2% Cas=%cas2%

no++ ;ces 2 variable des cas doivent être incrémenté ici après le tooltip
;np++ ;ces 2 variable des cas doivent être incrémenté ici après le tooltip
gosub, Cas

goto de

Cas:
inputbox, nom%no%,, Enter nom
inputbox, cas%no%,, Enter nom
Return


Yes it is, thanks. Is it what we call a array?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2009, 5:54 pm 
Offline

Joined: July 31st, 2008, 10:27 pm
Posts: 336
Yes, it is. An array is a set of variables with numbers after them.
Try this script:
Code:
Var1 =John
Var2 := "Tina"
Var7 = 72
Var11 := Var1
Var14 = 8
Var19 := Var7 + Var14
Var20 = Var7 + Var14

Loop, 20  ; A_index will have values 1-20
{
 If Var%A_Index%   ; If Var is not empty... Don't use the extra % on the left side of an expression
 MsgBox, % Var%A_Index%  ; Do use the extra % symbol in a MsgBox, or on the right side of an expression
}

MsgBox, End of array
Exit


Look at all the different ways a variable can be assigned. Make sure and look at the message box, and compare it to the way a variable was assigned. Also it is important to know when to use % Var%A_Index%, and when to use Var%A_Index%. It's difficult to explain, but I hope it helps!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto, Google Feedfetcher, LazyMan, poserpro, Tilter_of_Windmills and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group