[comp.sys.mac.hypercard] Sub-referencing a scrolling field

dbreece@silver.ucs.indiana.edu (Dave Breece) (04/19/91)

I'm extrememly new to Hypercard, and I'm having some problems getting
data from a scrolling field.

I have a scolling field with an invisible line-size button over each
line of the field.  What I want to be able to do is click on a
particular line of the field (and thus it's button), and be able to
extract the text of that line for use in another part of the stack. 

This works fine, until you start to scroll.  Brilliant no?

Is there a way to get the number of the field-line relative to what's
visible?  In other words, is there any way to call the line that's on
top line one, regardless of it's position in the field?

Confused yet?  Any and all help would be appreciated, as I'm
completely withough ideas.  I'd really like to avoid building my own
scrolling field from scratch.  Thanks in advance...

-ps  I'm also in desperate need of clip art!!!  Help!!!
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dave Breece ("Druid")                     "We are heros, we are dreamers
dbreece@silver.ucs.indiana.edu               of the big dream..."
dbreece@iubacs.bitnet                                            A/B/W/H

Mike_Dustan@ucs.sfu.ca (Mike Dustan) (04/20/91)

In article <dbreece.672049697@silver> dbreece@silver.ucs.indiana.edu (Dave 
Breece) writes:
> I have a scolling field with an invisible line-size button over each
> line of the field.  What I want to be able to do is click on a
> particular line of the field (and thus it's button), and be able to
> extract the text of that line for use in another part of the stack. 

Good idea, and one of the few ways in which you could do this kind of 
thing in HyperCard versions before 2.0. Version 2.0 gives you a far easier 
way to get the clicked line:

1. Make sure the field is locked, or clicks on it won't be intercepted.
2. In the field's script, put
   on mouseUp
      put the clickline into lineThatWasClicked -- reads like "line x of 
      -- bkgnd field y"
      select lineThatWasClicked -- will select the desired line for you
      get the selectedText -- gets the contents of any highlighted text
      -- do other stuff here.
   end mouseUp
3. Don't need the buttons any more.

You may have to experiment a bit  when getting the contents of the line. 
The above seems to work but I tested it for only about 15 seconds.

Hope this helps.

Mike