AutoHotkey Community

It is currently May 26th, 2012, 10:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next
Author Message
 Post subject:
PostPosted: October 31st, 2008, 6:21 pm 
Offline

Joined: December 13th, 2006, 7:16 am
Posts: 48
ClipboardAll is used to save data such as pictures, music, files, etc, and thus rather difficult to store as an array of strings.
If you would like to store a clipboard that only has text-data, you might as well use Clipboard instead of ClipboardAll.
Anyway, here's some quick untested code that should work:
Code:
arr := AHKA_NewArray();
Loop, parse, clipboard, `n, `r
{
  arr := AHKA_Add(arr, A_LoopField);
}

Hope that helps.

EDIT:
And yes, it should be just as easy with SimpleArray.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2008, 7:15 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
If you need to store binary data in an array you could use DerRaphael's [stdlib] A_Array - True Binary Arrays. It stores binary data directly in a variable. I'm not sure if it will work with ClipboardAll since it's handled in a special way, but you might be able to set a variable to the contents of ClipboardAll and pass the variable to the ByRef A_Set() function.

But if even that doesn't work, you could use my psuedo array library: [lib] pgArray - A solution for Manipulating AHK's Arrays

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 8th, 2008, 6:23 am 
Offline

Joined: November 4th, 2008, 9:23 am
Posts: 1045
Not sure if anyone mentioned this as an idea, but why don't you use escape characters?

Either use ` like AHK uses for default, or use \ like in some other programming languages.

This way you don't have to waste TONS of space converting everything to hex - since we are all used to escaping text.

If ` was the escape character
`[ would be a [
`] would be a ]
`| would be a |
`, would be a ,
`` would be a `

This way, less fuss, bet still able to use this amazing system.

So if the user has
"[12`[`,A,[1,2]]

The first element would be "12[,A"
The second element would be "[1,2]".

This solves the problem - if it still exists. Like I said, haven't read all the posts.

_________________
As always, if you have any further questions, don't hesitate to ask.

Add OOP to your scripts via the Class Library. Check out my scripts.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2008, 7:55 am 
Offline

Joined: December 13th, 2006, 7:16 am
Posts: 48
This has been mentioned, but is redundant due to hexing, as that fixes this problem.
The whole library is basically obsolete now.
It is in perfectly working condition, but I will no longer work on it.
Instead, I might work on the Linked List I created (see the first post of this topic), in order for it to become a replacement.
Controls characters are actually used in SA (SimpleArray) (or will be soon), which is actually more effective than escaping everything anyway.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2009, 7:19 pm 
Offline

Joined: February 17th, 2008, 5:01 pm
Posts: 303
Hi, olegbl, (or anyone else, as olegbl hasn't posted in a month and a half)

What do you mean by "The whole library is basically obsolete?" Do you mean that Infogulch's SimpleArray library renders it obsolete? I'd like to learn an array library, and I'm not sure which one to learn. (I want one that stores regular data in a string, so I've ruled out DerRaphael's A_Array and InfoGulch's pgArray.)

JS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2009, 8:16 pm 
Offline

Joined: December 13th, 2006, 7:16 am
Posts: 48
By obsolete I mean there's much more powerful (& fast) techniques for creating true arrays now than how AHKA does it. AHKA was built a while ago when some of these techniques simply weren't possible (or at least "invented" yet). For example, true binary arrays are perfectly possible now. (See http://www.autohotkey.com/forum/viewtopic.php?t=37512)
If you're just looking for an array lib. to use in another program I'd recommend InfoGulch's SimpleArray (http://www.autohotkey.com/forum/viewtopic.php?t=35041).


Report this post
Top
 Profile  
Reply with quote  
 Post subject: new_function
PostPosted: March 9th, 2009, 11:06 pm 
Would like to see AHKA_DeleteDuplicates function ...

It would be great to have function that deletes the duplicate values from array and rebuilds its index ...

Thank you in advance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2009, 12:17 am 
Offline

Joined: December 13th, 2006, 7:16 am
Posts: 48
Sorry, AHKA is outdated and I no longer support it or work on it.
You can ask InfoGulch to add this function to his array library (http://www.autohotkey.com/forum/viewtopic.php?t=35041).

Here's a quick mockup though.
Code:
index := 0
Loop
{
  tempIndex := AHKA_Find(array, AHKA_Get(array, index), -1)
  if (index != tempIndex)
  {
    array := AHKA_Remove(array, tempIndex)
    index --
  }
  index ++
  if (index > AHKA_Size())
    break
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2009, 4:47 pm 
Offline

Joined: October 12th, 2009, 3:32 am
Posts: 10
i'd just like to use a 2 dim array to track x,y coords for a couple hundred mouse clicks. code would look more clean with a 2 dim array but i dont see how to do it. i can use to dif arrays for now. i see something to do with multi dim under utils in doc but no info.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2009, 5:45 pm 
Offline

Joined: December 13th, 2006, 7:16 am
Posts: 48
Code:
; Some x,y Coordinates For Testing
x1 := 1
y1 := 1
x2 := 3
y2 := -2

; Initialize
myArray := AHKA_NewArray()

; Adding First Ordered Pair
myOrderedPair := AHKA_NewArray()
myOrderedPair := AHKA_Add(myOrderedPair, x1)
myOrderedPair := AHKA_Add(myOrderedPair, y1)
myArray := AHKA_Add(myArray, myOrderedPair)

; Let's Add Another Value, Quicker
myArray := AHKA_Add(myArray, AHKA_NewArray("[" + x2 + "," + y2 + "]"))

; Let's Retrieve Some Values
x1g := AHKA_Get(myArray, 1, 1)
y1g := AHKA_Get(myArray, 1, 2)
x2g := AHKA_Get(myArray, 2, 1)
y2g := AHKA_Get(myArray, 2, 2)


Hope that helps.

P.S. The utility functions aren't documented since they're not meant to be used by the end-user anyway (they're internally used, and in a real programming language would be declared as private), and I'm too lazy to document them for a product I no longer work on.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2009, 9:11 pm 
Offline

Joined: October 12th, 2009, 3:32 am
Posts: 10
ok i understand. burned out on this one ? working on anything else AHK related ? just curious.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 20th, 2009, 12:36 am 
Offline

Joined: December 13th, 2006, 7:16 am
Posts: 48
Well, this one simply became obsolete a couple of years ago with the invention of low_level, which allows you to have real data structures (linked lists, trees, etc), rather than parsed strings.

Not working on any AHK projects ATM.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 20th, 2009, 12:25 pm 
Not obsolete or useless. Some of use still have to make sure our scripts will work on Win9x boxes, and unfortunately, low_level will not work on those systems.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 20th, 2009, 3:35 pm 
Offline

Joined: December 13th, 2006, 7:16 am
Posts: 48
Haha, yes, I suppose for backwards-compatibility/support, AHKA would still be a choice. ^.^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2009, 5:15 pm 
Hi,

Is there any documentation available?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, JamixZol, spg SCOTT and 9 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