[jawsscripts] Re: chopping up block of text on Tab delimiters or via color? String monipulation,

  • From: "Donald Marang" <donald.marang@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Mon, 23 Mar 2009 22:15:47 -0400

I know that this would not be the normal usage for the StringSegmebt 
functions.  But wouldn't these functions work if you use "\9", which is the 
Tab character,  as the delimiter for  these functions in place of the 
typical "\7", which is the "|" character (or is it proper to use "\09" and 
"\07")  This could provide several easy features like a count of the 
segments (function key descriptions), easy extraction of a segment, and even 
display the entire string in a list dialog for possible execution. 
Actually, it might be easier to substitute the "\9" for "|", and use the 
StringSegment functions in their more normal usage.

For instance:
Let sKey3 = StringSegment (sFunctionKeys, "\9", 3)

would extract the third substring of the entire block of function keys which 
are in the string sFunctionKeys

or:
Let sFunctionKeys = StringReplaceChars (sFunctionKeys, "\9", "|")
; replaces all tabs with the "|" character

Let iChoice = DlgSelectItemInList (sFunctionKeys, "Funcction Key selection", 
False, 3)
; Displays a list of the function keys and their descriptions with a title 
and the third highlighted by default
; The return value, iChoice, is the integer index of the item selected

Let sKey = StringSegment (sFunctionKeys, "|", iChhoice)
; This would be the substring selected in the dialog.  Witth a little 
further manipulation or logic, you could have the function key executed
Good luck.

Don Marang


----- Original Message ----- 
From: "Geoff personal" <gch@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Sunday, March 22, 2009 9:19 PM
Subject: [jawsscripts] chopping up block of text on Tab delimiters or via 
color? String monipulation,


> aha Mighty Scripters.
>
> I wonder if someone might be able to assist me with some fancy string
> monipulation knowledge?
> I have a problem in a terminal emulation environment application I am
> scripting, whereby there's this whole 3 line block of helper text for the
> user , denoting the role of the function keys on any given screen.
> However of course, they don't have nice periods after each one, nor even
> commas, so speaking a GetTextInRect on the block of course just spiews 
> them
> all out in one unpleasantly incomprehensible continuous stream of text.
> However of course on each screen, the length of each function key
> prompt/string of text which needs pauses inserted between them, and which 
> I
> wish also to split up to place one below the other in the virtual viewer
> upon a double click of this key,
> alters!  Such that I can't just successfully delineate things with simple
> static GetTextInRect functions.
>
> So, what I'm wondering, is, what other options might be available to me to
> do this?
> Now there are what Jaws identifies as, Tabs, sitting between each one, 
> which
> I was thinking if I knew how to get functions to do something like this:
> take the block of text, then move along till you find the first tab, then
> chop that from the left and assign it to a string,
> then move along to the next piece of actual text, starting counting from
> there, then when you reach the next Tab, chop that out and assign it to 
> some
> string, ... etc, I thought I could then achieve this.
> But, I've no idea how I might go about doing this? I'm not at all really
> adept yet at handling the return values of functions, and feeding them 
> into
> new new functions
> as parameters upon which the next function acts? Which I'm fairly sure is
> what I'm going to be needing to be able to do, in order to achieve this 
> one?
>
> Or, the other thought I had was to maybe delineate by color instead.
> All the actual text in the block, is CornFlower blue on Black. i.e, in
> integer land,
> 15765624 on 0.
> Whereas the Tabs in between each helper prompt string that I wish to 
> insert
> pauses into and be able to deal with individually in virtual viewer,
> is the standard Lime Green on Black terminal emulation color. i.e. in
> integer land,
> 3201060 on 0.
> Though interestingly, even with Hsc ReadPixel Color command, I'm unable to
> find any pixels in my tab identified spot, that report themselves as that
> Lime green color, even though JawsKey+top row 5, reports the tab as Lime
> Green on black.
>
> Might I be able to utilize something which looked for color instead, to
> achieve what I'm after?
> What would people suggest might be the bestest approach for this.
>
> Thanks so much for any tips or exemplery code anyone might have time to
> throw up at me on this one.
>
> geoff c.
>
>
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
> 

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: