[comp.sys.mac.hypercard] help with returnInField message

edc@aeras.UUCP (news guest account) (09/03/88)

Ok, here's my problem:

I have a field called entry and another called lst.  lst is a scrolling field.
The idea is I want the first line of the entry field to be copied into
the lst field whenever I hit a return key in the entry field.

What's wrong with this script:

on returnInField
  get line 1 of field "entry"
  put it into line 1 of field "lst"
  CloseField
end returnInField

This is the script for my entry field.  When I hit the return key, it
crashes the system. Is it because I am not clearing the entry field?
why won't CloseField do the job? How do I clear the contents of a field 
anyway.  
thanx,
-edc-

dan@Apple.COM (Dan Allen) (09/06/88)

In article <265@aeras.UUCP> edc@aeras.UUCP (news guest account) writes:
>Ok, here's my problem:
>
>I have a field called entry and another called lst.  lst is a scrolling field.
>The idea is I want the first line of the entry field to be copied into
>the lst field whenever I hit a return key in the entry field.
>
>What's wrong with this script:
>
>on returnInField
>  get line 1 of field "entry"
>  put it into line 1 of field "lst"
>  CloseField
>end returnInField
>
>This is the script for my entry field.  When I hit the return key, it
>crashes the system. Is it because I am not clearing the entry field?
>why won't CloseField do the job? How do I clear the contents of a field 
>anyway.  

What does CloseField do? Is that another script of yours? Or do you mean
to send the message closeField? How does the system crash? Are you using
HC 1.2? Auto-tab is set for this field?  Are they card or bkgnd fields?

Dan Allen
Apple Computer

edc@aeras.UUCP (news guest account) (09/08/88)

In article <16641@apple.Apple.COM> dan@apple.com.UUCP (Dan Allen) writes:
>In article <265@aeras.UUCP> I write:
>>
>>on returnInField
>>  get line 1 of field "entry"
>>  put it into line 1 of field "lst"
>>  CloseField
>>end returnInField
>>
>
>What does CloseField do? Is that another script of yours? Or do you mean
>to send the message closeField? How does the system crash? Are you using
>HC 1.2? Auto-tab is set for this field?  Are they card or bkgnd fields?

I guess I'm trying to send that message.  The fields in question are card
fields.  What happens is that the pointer stays a cursor and all the menus
are disabled.  It's as though I can't send any messages.

I'm not sure I understand what Auto-tab is supposed to do.  How do you set
it anyway?   

Oh I'm using 1.2.1....

>Dan Allen
>Apple Computer

Thanx,
-edc-

dan@Apple.COM (Dan Allen) (09/09/88)

In article <268@aeras.UUCP> edc@aeras.UUCP (news guest account) writes:
>I'm not sure I understand what Auto-tab is supposed to do.  How do you set
>it anyway?   

Auto-tab can be set by a script or by the field info dialog.  Auto tab
automatically will tab to the next field when you hit a return in the
last line of a field.  If you have a field with only one line showing,
then hitting return will advance you to the next field.  (And a return
will NOT be entered into the field, which sometimes is something people
really want to do.)

Whenever you tab out of a field, a closeField message is automatically
sent.  There is no need for you to artificially send the message under
normal conditions.  I am still not sure what you are trying to do and
why you are having problems...

Dan Allen
Apple Computer