AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: October 25th, 2009, 4:17 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2009, 6:26 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6065
Location: San Diego, California
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.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: AndyJenk, JSLover, Leef_me, patgenn123, rbrtryn, XstatyK and 70 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