AutoHotkey Community

It is currently May 27th, 2012, 1:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: SimpleArray
PostPosted: June 2nd, 2009, 10:12 am 
Offline

Joined: May 31st, 2009, 6:40 am
Posts: 12
anyone have any examples of code using this function. It would save me quite a bit of time as there is little documentation and im still a bit new with this.

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2009, 5:37 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
You could send a PM to the author of the function... looks like he had intended to write some documentation in the beginning. There are at least a couple more array functions in the Scripts & Functions forum also.

You may find either of these easier to use.
AHKArray [Real Array - One Variable] [Version 6]
[stdlib] A_Array - True Binary Arrays RC2 (w/ testsuite)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2009, 7:15 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Regarding: http://www.autohotkey.com/forum/viewtopic.php?t=35041

Fingers crossed that particular lib is going to be updated + documented
in the near future, here are some basic usage examples:
Code:
; adding values to array

Stack:=SA_Set(Stack, 3) ; stack: 3
Stack:=SA_Set(Stack, 2) ; stack: 3-2
Stack:=SA_Set(Stack, 4, +2, true) ; stack: 3-4-2, e.g. insert 4 at position 2 in array
Stack:=SA_Set(Stack, 1) ; stack: 3-4-2-1
Stack:=SA_Set(Stack, 8, -1, true) ; stack: 3-4-2-8-1 , e.g. insert 8 at one to last position

;Var:=SA_Get(Stack, -1) ; =1 get last stack item
MsgBox % SA_Get(Stack, -1) ; =1 get last stack item
MsgBox % SA_Get(Stack, 2) ; =4 second item

MsgBox % SA_Len(Stack) ; 5
Stack:=SA_Del(Stack, -1) ; remove last item from array (-1)
MsgBox % SA_Len(Stack) ; 4

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], chaosad and 13 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