ID's for linked text?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ID's for linked text?

Derek Larsen
I have a text field that has specific paragraphs setup as linked. I'd like
to find a dynamic way to find out which one of those paragraphs the user
clicked on without having to know the content of the paragraph.



Is there any kind of ID or number associated with each link? I haven't been
able to find anything useful in the documentation.



Any insight would be appreciated.


Thanks!

--
Derek Larsen
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: ID's for linked text?

Jim Ault
On 5/11/06 8:07 AM, "Derek Larsen" <[hidden email]> wrote:

> I have a text field that has specific paragraphs setup as linked. I'd like
> to find a dynamic way to find out which one of those paragraphs the user
> clicked on without having to know the content of the paragraph.
> Is there any kind of ID or number associated with each link? I haven't been
> able to find anything useful in the documentation.
>
> Any insight would be appreciated.
>
There is no ID that I know of, but you could make one.
You could make the paragraph the key of an array and the element would be
the number/code you use to know which paragraph is chosen.

Is your paragraph defined by CR's?
Are they long or short text runs?
Is the entire paragraph the link?

You could use an array or custom properties of the stack.
Your paragraphs will become the keys of a single array or each paragraph
will become a custom property of the stack.  In each case, the paragraphs
must be unique for all characters, otherwise, two identical paragraphs will
end up being the same key of an array or custom property.

--array method
global gParagraphArray
set the itemdel to cr
put item 1 of fld readingMaterial into keyTxt
put (the short id of this card &"c"&1) into gParagraphArray[keyTxt]

put item 2 of fld readingMaterial into keyTxt
put (the short id of this card &"c"&2) into gParagraphArray[keyTxt]

thus a loop is born......
repeat with x = 1 to the number of items in fld readingMaterial
   put item x of fld readingMaterial into keyTxt
   put (the short id of this card &"c"&x) into gParagraphArray[keyTxt]
end repeat

set the itemdel to comma

--------------------------------------
custom property method
set the itemdel to cr
repeat with x = 1 to the number of items in fld readingMaterial
   put item x of fld readingMaterial into keyTxt
   set the keyTxt of this stack to (the short id of this card &"c"&x)
end repeat
---------------------
Now you need to write a couple routines to handle changes you make to the
text, thus the stored text becomes obsolete

clear global gParagraphArray
repeat with c = 1 to the number of cards
--add to the global array here
end repeat
---or----
set the customproperties of this stack to empty
repeat with c = 1 to the number of cards
--add to the customproperties here
end repeat

This will double the size of your stack, since all of the text will be
stored twice.   There are many other variations, but you get the gist.
Hope this gives you some ideas


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
Reply | Threaded
Open this post in threaded view
|

Re: ID's for linked text?

xtalkprogrammer
In reply to this post by Derek Larsen
Hi Derek,

This returns the number of the paragraph you clicked on:

on mouseUp
   put number of lines of (char 1 to (word 4 of the clickChunk) of me)
end mouseUp

assuming that paragraphs are separated by returns. Put this script  
into a field script.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Salery is the easiest way to get your own web store on-line: http://
www.salery.biz/salery.html



Op 11-mei-2006, om 17:07 heeft Derek Larsen het volgende geschreven:

> I have a text field that has specific paragraphs setup as linked.  
> I'd like
> to find a dynamic way to find out which one of those paragraphs the  
> user
> clicked on without having to know the content of the paragraph.
>
>
>
> Is there any kind of ID or number associated with each link? I  
> haven't been
> able to find anything useful in the documentation.
>
>
>
> Any insight would be appreciated.
>
>
> Thanks!
>
>
_______________________________________________
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
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Re: ID's for linked text?

Chris Sheffield-2
In reply to this post by Derek Larsen
Derek,

You also might want to check the linkText property in the  
documentation. This might be what you want.

Chris


On May 11, 2006, at 9:07 AM, Derek Larsen wrote:

> I have a text field that has specific paragraphs setup as linked.  
> I'd like
> to find a dynamic way to find out which one of those paragraphs the  
> user
> clicked on without having to know the content of the paragraph.
>
>
>
> Is there any kind of ID or number associated with each link? I  
> haven't been
> able to find anything useful in the documentation.
>
>
>
> Any insight would be appreciated.
>
>
> Thanks!
>
> --
> Derek Larsen
> _______________________________________________
> 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

------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: ID's for linked text?

Ken Ray
In reply to this post by Derek Larsen
On 5/11/06 10:07 AM, "Derek Larsen" <[hidden email]> wrote:

> I have a text field that has specific paragraphs setup as linked. I'd like
> to find a dynamic way to find out which one of those paragraphs the user
> clicked on without having to know the content of the paragraph.
>
>
>
> Is there any kind of ID or number associated with each link? I haven't been
> able to find anything useful in the documentation.

Not really, but if you want to use HTML, you can add your own ID to linked
text... for example if you do this:

put "<a href=" & quote & "Test" & quote & ">This is a test</a>" into tHTML
set the htmlText of fld 1 to tHTML

and then have code in the field that says:

on linkClicked pLink
  answer pLink
end linkClicked

When you click on the "This is a test" link text, it will answer "Test".

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [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
Reply | Threaded
Open this post in threaded view
|

Re: ID's for linked text?

Derek Larsen
Wow, Thanks everyone! I've got some good options to choose from.

Thanks again.

--
Derek


On 5/11/06, Ken Ray <[hidden email]> wrote:

>
> On 5/11/06 10:07 AM, "Derek Larsen" <[hidden email]> wrote:
>
> > I have a text field that has specific paragraphs setup as linked. I'd
> like
> > to find a dynamic way to find out which one of those paragraphs the user
> > clicked on without having to know the content of the paragraph.
> >
> >
> >
> > Is there any kind of ID or number associated with each link? I haven't
> been
> > able to find anything useful in the documentation.
>
> Not really, but if you want to use HTML, you can add your own ID to linked
> text... for example if you do this:
>
> put "<a href=" & quote & "Test" & quote & ">This is a test</a>" into tHTML
> set the htmlText of fld 1 to tHTML
>
> and then have code in the field that says:
>
> on linkClicked pLink
> answer pLink
> end linkClicked
>
> When you click on the "This is a test" link text, it will answer "Test".
>
> HTH,
>
> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: [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
>
_______________________________________________
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