AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parsing a clipboard with array rows?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Notw00tstick.
Guest





PostPosted: Sun Oct 25, 2009 3:17 am    Post subject: Parsing a clipboard with array rows? Reply with quote

This is what I have
Code:
 
letters = ABCDEFGHIJKLMNOPQRSTUMWXYZ
StringSplit, letter, letters
Loop, Parse, ClipBoard, `,
   data .= "Row " letter%A_Index% " = " (A_LoopField ? A_LoopField : "N/A") "`n"
Sendinput %data%


When I copy something like this:

Quote:

STOP,00270103,0x0001003B09ECC1C4,1991967974


This is the result I get when I type test1.

Quote:

Row A = STOP
Row B = 00270103
Row C = 0x0001003B09ECC1C4
Row D = 1991967974


I want to do 2 things to this.

One I want to alter row's to different names like


Quote:

Timer = STOP
Switch = 00270103
Hex = 0x0001003B09ECC1C4
Number = 1991967974



And second I want to only display certain rows that I want.
Like


Quote:

Timer = STOP
Hex = 0x0001003B09ECC1C4



Any help is appreciated. Thanks.
Back to top
Leef_me



Joined: 08 Apr 2009
Posts: 1158
Location: San Diego, California

PostPosted: Sun Oct 25, 2009 5:26 am    Post subject: Reply with quote

To the end of your original script try adding this line
Code:
msgbox %letter3%%letter1%%letter20%


BTW, You have a typo --->
Quote:
letters = ABCDEFGHIJKLMNOPQRSTUMWXYZ


Quote:
One I want to alter row's to different names like
I think you need to read up more on this command to understand what it does: http://www.autohotkey.com/docs/commands/StringSplit.htm

Also check out this example from 'StringSplit' look at the listvars window that shows up, particularly the variables Colorarray1 .. 2.. 3 .
Code:
Colors = red,green,blue
StringSplit, ColorArray, Colors, `,
Loop, %ColorArray0%
{
    this_color := ColorArray%a_index%
    MsgBox, Color number %a_index% is %this_color%.
}
listvars
msgbox
By reviewing the above example and reading, you can see how to create a list of alternate row names.
Hint: red & green aren't much different than Timer & Switch

Your original parsing loop could also store the useful data in an array, and using an index, you can retrieve the data in any order.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group