Re-2: search for regular expression in text and put the results into an array

32 messages Options
Embed this post
Permalink
1 2
runrev260805

Re-2: search for regular expression in text and put the results into an array

Reply Threaded More More options
Print post
Permalink
Hi,

first thanks to all for the suggestions. As i am unfamiliar with the offset function and i was a little in a hurry i used Jim´s script and extended it to my needs.

@Jim

Line 8 of your example should be

filter xmlBlock without "<statuses type='array'>*"

shouldn´t it.

Thanks again.

Matthias



-------- Original Message --------
Subject: Re: search for regular expression in text and put the results into an array (05-Nov-2009 6:41)
From:    Jim Ault <[hidden email]>
To:      [hidden email]

> I don't use the xml library to do the simple tag processing for three  
> types of tags
> Chunk expressions are so fast that I get better speed and control of  
> the data parsing.
>
> ------- Use these steps to get started----
>
> on test
>     replace cr with empty in xmlBlock
>     replace quote with "'" in xmlBlock  --(apostrophe ' char)
>     --now you can use quote expressions without worries
>     --   such as in the next line
>     replace "<statuses type='array'>" with (cr & "<statuses  
> type='array'>") in xmlBlock
>     filter xmlBlock with "<statuses type='array'>*"
>
>     put 0 into statusCount
>     repeat for each line statusArrLine in xmlBlock
>        replace "<status>" with (cr & "<status>") in statusArrLine
>        replace "</status>" with ("</status>" & cr) in statusArrLine
>        filter statusArrLine with "<status>*"
>
>        repeat for each line statusTag in statusArrLine
>           replace "<status>" with empty in statusTag
>           replace "</status>" with empty in statusTag
>           --now we have the data only, and on a single line
>           add 1 to statusCount
>           put statusTag into storArray[statusCount]
>
>        end repeat
>     end repeat
>
>     --> statusCount = total
>     --> storArray[num] = strings storage
> end test
>
> Hope this helps.
>
> Jim Ault
> Las Vegas
>
> On Nov 4, 2009, at 4:06 PM, [hidden email] wrote:
>
> > Hi,
> >
> > I am absolutely new to XML, so please forgive me for this question.
> >
> > I have an XML file which looks similar like this.
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <statuses type="array">
> > <status>blah blah bla
> >   <some other>blah blah blah
> >      <and so on></status>
> >
> >
> > The <status>...</status> part is repeating many times, but with  
> > different content.
> >
> > i want to put the <status>...</status>part  into an array. So i get  
> > to know how often this part is in the xml file. I then want to  
> > extract some text of each of this <status>....</status> section. My  
> > main problem is how to seperate each <Status...> </status> section.  
> > Do i have to use the XML library? Or is there another way?
> >
> > Regards,
> >
> > Matthias
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>
>
> To: [hidden email]


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Ault

Re: Re-2: search for regular expression in text and put the results into an array

Reply Threaded More More options
Print post
Permalink
On Nov 5, 2009, at 2:16 PM, [hidden email] wrote:

> Hi,
> first thanks to all for the suggestions. As i am unfamiliar with the  
> offset function and i was a little in a hurry i used Jim´s script  
> and extended it to my needs.
> @Jim
> Line 8 of your example should be
> filter xmlBlock without "<statuses type='array'>*"
> shouldn´t it.
Perhaps, since I just typed the script without testing in order to  
give the basic structure I use.
However,
the scheme was to make each line in the xmlBlock start with <statuses  
type='array'> and include only those lines.

"<statuses type='array'><status>blah blah blah<moredata>blah</
moredata></status>"
"<statuses type='array'><status>blah blah blah<moredata>blah</
moredata></status>"
"<statuses type='array'><status>blah blah blah<moredata>blah</
moredata></status>"
"<statuses type='array'><status>blah blah blah<moredata>blah</
moredata></status>"

Now the repeat loop will cycle through them and do the parsing.

Glad it helped you move on to the next programming task.

Jim Ault
Las Vegas

> -------- Original Message --------
> Subject: Re: search for regular expression in text and put the  
> results into an array (05-Nov-2009 6:41)
> From:    Jim Ault <[hidden email]>
> To:      [hidden email]
>
>> I don't use the xml library to do the simple tag processing for three
>> types of tags
>> Chunk expressions are so fast that I get better speed and control of
>> the data parsing.
>>
>> ------- Use these steps to get started----
>>
>> on test
>>    replace cr with empty in xmlBlock
>>    replace quote with "'" in xmlBlock  --(apostrophe ' char)
>>    --now you can use quote expressions without worries
>>    --   such as in the next line
>>    replace "<statuses type='array'>" with (cr & "<statuses
>> type='array'>") in xmlBlock
>>    filter xmlBlock with "<statuses type='array'>*"
>>
>>    put 0 into statusCount
>>    repeat for each line statusArrLine in xmlBlock
>>       replace "<status>" with (cr & "<status>") in statusArrLine
>>       replace "</status>" with ("</status>" & cr) in statusArrLine
>>       filter statusArrLine with "<status>*"
>>
>>       repeat for each line statusTag in statusArrLine
>>          replace "<status>" with empty in statusTag
>>          replace "</status>" with empty in statusTag
>>          --now we have the data only, and on a single line
>>          add 1 to statusCount
>>          put statusTag into storArray[statusCount]
>>
>>       end repeat
>>    end repeat
>>
>>    --> statusCount = total
>>    --> storArray[num] = strings storage
>> end test
>>
>> Hope this helps.

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Rice

lineoffset

Reply Threaded More More options
Print post
Permalink
I know there is something real easy I'm missing but;

why doesn't this work?

on mouseUp
   set itemdel to "|"
   get the clicktext
   put lineoffset (it, item 1 of cd field "storage")
end mouseUp

Thanks
Rick
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
dunbarx

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
Rick.

This looks good to me. I pasted directly into a locked field. What is the
error you get?

Craig Newman

In a message dated 11/6/09 2:18:53 PM, [hidden email] writes:


> on mouseUp
>    set itemdel to "|"
>    get the clicktext
>    put lineoffset (it, item 1 of cd field "storage")
> end mouseUp
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Ault

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice


On Nov 6, 2009, at 11:17 AM, Rick Rice wrote:

> I know there is something real easy I'm missing but;
>
> why doesn't this work?
>
> on mouseUp
>  set itemdel to "|"
>  get the clicktext
>  put lineoffset (it, item 1 of cd field "storage")
> end mouseUp



Not knowing what is in the field, I will take a guess.

Try
  set itemdel to "|"
  put item 1 of cd field "storage" into testValue
  breakpoint  --now look at the string in testValue

Also
  put lineoffset(it, item 1 of cd field "storage") --
  -- no space after 'lineoffset'


Also remember that an 'item' is considered a smaller chunk than a  
line, so that the following does not make sense to Rev
        put line 2 of item 4 of field "storage"

What you would need to do to follow the rules is
set the lineDel to "|"
set the itemDel to cr
put item 2 of line 4 of field "storage"
-- now multiple visible lines in the field would be considered as  
items for the purposes of chunk expressions.

By the way, cd field is not necessary in Rev, but works because of the  
compatibility routines that allow much of Hypercard to work in Rev.

Hope this helps,

Jim Ault
Las Vegas
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Rice

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by dunbarx
It looks to me like it should work and in fact I do not get any  
script error message when I enter the script and then close the script.
No mater the clicktext it comes back with "0"
Rick

On Nov 6, 2009, at 12:03 PM, [hidden email] wrote:

> Rick.
>
> This looks good to me. I pasted directly into a locked field. What  
> is the
> error you get?
>
> Craig Newman
>
> In a message dated 11/6/09 2:18:53 PM, [hidden email] writes:
>
>
>> on mouseUp
>>    set itemdel to "|"
>>    get the clicktext
>>    put lineoffset (it, item 1 of cd field "storage")
>> end mouseUp
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Ault

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice
A second thought....
It looks like you might be thinking that you want to restrict the  
'hit' to the first item of each line in the field.

To do that you would need to do something like

set the itemdel to "|"
get cr & the clicktext & "|"
put  lineOffset( IT, (cr & field "storage"))

thus the match can only occur if the clicktext is exactly the first  
item of a line

Hope this helps,

Jim Ault
Las Vega

On Nov 6, 2009, at 11:17 AM, Rick Rice wrote:

> I know there is something real easy I'm missing but;
>
> why doesn't this work?
>
> on mouseUp
>  set itemdel to "|"
>  get the clicktext
>  put lineoffset (it, item 1 of cd field "storage")
> end mouseUp

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Shao Sean-2

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice
Jim, if I remember correctly from having to do something like this in  
the past, your solution will not get the first line because it does  
not start off with the CR from the previous line (unless I am missing  
something else in this thread in which case, ignore me like my mom  
does ;-)
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Shao Sean-2

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice
Rick, can you give us an example of the data in the field? If the text  
is something like "moo|cow" then the clickText will return the whole  
line "moo|cow" and not just the first item like it looks like you are  
trying to do..
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
dunbarx

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice
I made a "storage" field, and put text into it. The working field has
similar text.

When I click on text in the working field (with the mouseUp handler), the
message box gives me the line number of the text in the "storage" field. No
problem, no errors.

And yes, it will give only the first instance, because that is how it is
written. Getting others is another story, but your problem is getting it to
work at all, correct?

Craig Newman
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Ault

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Shao Sean-2


On Nov 6, 2009, at 1:21 PM, Shao Sean wrote:

> Jim, if I remember correctly from having to do something like this  
> in the past, your solution will not get the first line because it  
> does not start off with the CR from the previous line (unless I am  
> missing something else in this thread in which case, ignore me like  
> my mom does ;-)


The key is to make the IT variable start with a CR in order to include  
only hits at the beginning of a line
and the search text beginning with a CR so that hits can only be true  
at the start of a line.

thus...

get ( cr & the clicktext & "|" )  --string to find

put lineOffset( IT, (cr & fld "storage"))  --text block to search
-- so that the search text begins with a CR and the field does not  
have to
.
--- example text ------------
rainbow| clouds rain sunshine
photo| rain rainbow lightning
image| party balloon cake
balloon| red float photo smile noise

Clicking on any word will get the line number of 0 or > 0.
"rainbow" will = 1, photo = 2, balloon = 4.

Mom says hi.

Jim Ault
Las Vegas
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Rice

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Shao Sean-2
Hey thanks Jim and Shao and Craig:

What I have is a field "storage" in which detailed descriptions of  
various white blood cells is stored. Like this;
        Myeloblast|and now a detailed discussion of Myeloblast ..............
        Promyelocyte|and now a detailed discussion of  
Promyelocyte ..............
        Myelocyte|and now a detailed discussion of Myelocyte ..............
        Metamyelocyte|and now a detailed discussion of  
Metamyelocyte ..............

In a list field in which I have the list of cells like this;
        Myeloblast
        Promyelocyte
        Myelocyte
        Metamyelocyte
        etc ....

Then I have another field called "display"

So in the list field script I have the script:
> on mouseUp
>    set itemdel to "|"
>    get the clicktext
>    put lineoffset (it, item 1 of cd field "storage")
        and other stuff
> end mouseUp

        What I want is for the student to click on a cell name in the list  
field. Take the name they clicked on and look for it as the first  
item in the storage field. Once it has found the line in the storage  
field then take item 2 of that line and put it into the display field.

As I said, when I enter the script the editor accepts it and does not  
give any error but, it always returns 0

Rick


On Nov 6, 2009, at 1:24 PM, Shao Sean wrote:

> Rick, can you give us an example of the data in the field? If the  
> text is something like "moo|cow" then the clickText will return the  
> whole line "moo|cow" and not just the first item like it looks like  
> you are trying to do..
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Ault

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jim Ault
I suppose I should be a little more clear on why this works with  
lineOffset

lineOffset finds the first match in a text block.
If the string to find includes one or more cr's then it is a multiline  
match with the return value being the first line value.

Eg.  using these 4 lines ----------
rainbow| clouds rain sunshine
photo| rain rainbow lightning
image| party balloon cake
balloon| red float photo smile noise


lineOffset of   ("cake
balloon| red float photo smile noise")
is 3

lineOffset of   ("rainbow lightning
image| party balloon cake
balloon| red")
is 2

Jim Ault
Las Vegas

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Ault

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice
Like I said before, you need to answer the question:

What is ( item 1 of field "storage" ) ?
Use the variable watcher and breakpoint.
This will show you why you would get 0 (not located)
unless you clicked 'Myeloblast', and then you would get 1.

Jim Ault
Las Vegas


What is the
On Nov 6, 2009, at 3:07 PM, Rick Rice wrote:

> Hey thanks Jim and Shao and Craig:
>
> What I have is a field "storage" in which detailed descriptions of  
> various white blood cells is stored. Like this;
> Myeloblast|and now a detailed discussion of Myeloblast ..............
> Promyelocyte|and now a detailed discussion of  
> Promyelocyte ..............
> Myelocyte|and now a detailed discussion of Myelocyte ..............
> Metamyelocyte|and now a detailed discussion of  
> Metamyelocyte ..............
>
> In a list field in which I have the list of cells like this;
> Myeloblast
> Promyelocyte
> Myelocyte
> Metamyelocyte
> etc ....
>
> Then I have another field called "display"
>
> So in the list field script I have the script:
>> on mouseUp
>>   set itemdel to "|"
>>   get the clicktext
>>   put lineoffset (it, item 1 of cd field "storage")
> and other stuff
>> end mouseUp
>
> What I want is for the student to click on a cell name in the list  
> field. Take the name they clicked on and look for it as the first  
> item in the storage field. Once it has found the line in the storage  
> field then take item 2 of that line and put it into the display field.
>
> As I said, when I enter the script the editor accepts it and does  
> not give any error but, it always returns 0
>
> Rick
>
>
> On Nov 6, 2009, at 1:24 PM, Shao Sean wrote:
>
>> Rick, can you give us an example of the data in the field? If the  
>> text is something like "moo|cow" then the clickText will return the  
>> whole line "moo|cow" and not just the first item like it looks like  
>> you are trying to do..
>> _______________________________________________
>> use-revolution mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

Jim Ault
[hidden email]



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
dunbarx

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice
Rick.

Silly us, I think. Your text in which to search is only the first item of
the storage field:

on mouseUp
   set itemdel to "|"
   get the clicktext
   put lineoffset (it, item 1 of cd field "storage")
end mouseUp

You are trying to find the clicktext in the first item of that field.
Probably not much text there. Test with text that you know is in that very first
item.

One of my first forays into rev was to rewrite Frederic Rinaldi's
"fullFind", because I constantly need to find every instance of a word and its line
numbers. If you are interested, try calling this and see if it gives any
results. Or you might try your original script with very simple words. If it
works, then you have spelling problems, or, more likely, hidden chars that are
preventing the find from succeeding.

on mouseUp
    set itemdel to "|"
    get the clicktext
    put revFullFind fld "storage",it,"lineNum","true"
end mouseUp



function revFullFind tText,tFind,form,exactly
    switch
       case exactly = "true" and form = "lineNum"
          repeat for each line tline in tText
             add 1 to counter
             if tFind = tline then
                put counter & return after temp22
             end if
          end repeat
          break
       case exactly = "true" and form = "txt"
          repeat for each line tline in tText
             add 1 to counter
             if tFind = tline then
                put theLine & return after temp22
             end if
          end repeat
          break
       case exactly = "false" and form = "lineNum"
          repeat for each line tline in tText
             add 1 to counter
             if tFind is in tline then
                put counter & return after temp22
             end if
          end repeat
          break
       case   exactly = "false" and form = "txt"
          repeat for each line tline in tText
             add 1 to counter
             if tFind is in tline then
                put theLine & return after temp22
             end if
          end repeat
          break
    end switch
    return temp22
end revFullFind

Craig Newman

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
dunbarx

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rick Rice
Jim.

I just reread your post. I think you are saying the same thing, that there
ain't much text in the first item of the search list.

Craig

In a message dated 11/6/09 6:24:48 PM, [hidden email] writes:


> Like I said before, you need to answer the question:
>
> What is ( item 1 of field "storage" ) ?
> Use the variable watcher and breakpoint.
> This will show you why you would get 0 (not located)
> unless you clicked 'Myeloblast', and then you would get 1.
>
> Jim Ault
> Las Vegas
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Rice

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
Jim:
        You nailed it.
Item 1 of field "storage" is in fact Myeloblast.
If I click "Myeloblast" I get 1 if I click any other name the  
lineoffset returns 0

Craig:
I tried the fullfind routine and this returned "revFullFind"


Maybe what I should do is simply use a repeat loop and look at each  
item 1 of each line. If it matches the clicktext then I have the line  
number and can load item 2 of that line into the display field.

Rick

On Nov 6, 2009, at 3:38 PM, [hidden email] wrote:

> Jim.
>
> I just reread your post. I think you are saying the same thing,  
> that there
> ain't much text in the first item of the search list.
>
> Craig
>
> In a message dated 11/6/09 6:24:48 PM, [hidden email] writes:
>
>
>> Like I said before, you need to answer the question:
>>
>> What is ( item 1 of field "storage" ) ?
>> Use the variable watcher and breakpoint.
>> This will show you why you would get 0 (not located)
>> unless you clicked 'Myeloblast', and then you would get 1.
>>
>> Jim Ault
>> Las Vegas
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Jim Ault

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
>
> Maybe what I should do is simply use a repeat loop and look at each  
> item 1 of each line. If it matches the clicktext then I have the  
> line number and can load item 2 of that line into the display field.


Use this field script and it should work, plus a bit of error checking

on mouseup
    set the itemdel to "|"
    get (cr & field "storage")
    put  lineOffset( cr & the clicktext & "|", IT ) into theLineNum
    if theLineNum > 0 then
       put  item 2 to -1 of line theLineNum of IT into fld "display"

       --note item 2 to -1  means item 2 to the last item in the line
       --   the reason is in case the text of the line uses a "|" char
       --   if that is true, then you would not display the entire line
    else
       put "Not found" into fld "display"
    end if
end mouseup

Jim Ault
Las Vegas



On Nov 6, 2009, at 3:55 PM, Rick Rice wrote:

> Jim:
> You nailed it.
> Item 1 of field "storage" is in fact Myeloblast.
> If I click "Myeloblast" I get 1 if I click any other name the  
> lineoffset returns 0
>
> Craig:
> I tried the fullfind routine and this returned "revFullFind"
>
>
> Maybe what I should do is simply use a repeat loop and look at each  
> item 1 of each line. If it matches the clicktext then I have the  
> line number and can load item 2 of that line into the display field.
>
> Rick
>
> On Nov 6, 2009, at 3:38 PM, [hidden email] wrote:
>
>> Jim.
>>
>> I just reread your post. I think you are saying the same thing,  
>> that there
>> ain't much text in the first item of the search list.
>>
>> Craig
>>
>> In a message dated 11/6/09 6:24:48 PM, [hidden email] writes:
>>
>>
>>> Like I said before, you need to answer the question:
>>>
>>> What is ( item 1 of field "storage" ) ?
>>> Use the variable watcher and breakpoint.
>>> This will show you why you would get 0 (not located)
>>> unless you clicked 'Myeloblast', and then you would get 1.

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Rice

Re: lineoffset

Reply Threaded More More options
Print post
Permalink
Jim:
It works eh!
Had to make one slight change.
Had to add 1 to theLineNum
Thanks a bunch.
Rick

On Nov 6, 2009, at 4:39 PM, Jim Ault wrote:

> on mouseup
>    set the itemdel to "|"
>    get (cr & field "storage")
>    put  lineOffset( cr & the clicktext & "|", IT ) into theLineNum
>    if theLineNum > 0 then
>       put  item 2 to -1 of line theLineNum of IT into fld "display"
>
>       --note item 2 to -1  means item 2 to the last item in the line
>       --   the reason is in case the text of the line uses a "|" char
>       --   if that is true, then you would not display the entire line
>    else
>       put "Not found" into fld "display"
>    end if
> end mouseup

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Rick Harrison

Stack name Standalone bug?

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jim Ault

In a desktop application the following works fine:

    put the filename of this stack into VarShowStackName
    answer "VarShowStackName = " & VarShowStackName

It returns nothing in a Standalone on On-Rev.

Am I missing some library, or is this a bug?

Can anyone please confirm?

Thanks,

Rick

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
1 2