CustomKeys behavior

Ken Ray kray at sonsothunder.com
Sun Apr 14 09:25:00 EDT 2002


Tariel,

I believe your problem stems from not quoting 'tbRowData'. Left unquoted, it
can be interpreted as a variable or as a string. What determines this is if
the variable is used anywhere in the handler that is being executed. When
you only have:

> on mouseup
>   set the customkeys[tbRowData] of grp "Table" to empty
> end  mouseup

... 'tbRowData' is not used anywhere else in the handler, so Rev interprets
it as the string "tbRowData". However, in your button 'c':

> on mouseup
>   set the customkeys[tbRowData] of grp "Table" to empty
>   set the tbRowData["MyProperty"] of grp "table"  to SomeRowData
> end  mouseup

... 'tbRowData' is used as an array and so Rev tries to interpret it as a
variable and fails to work. I'd recommend trying:

on mouseup
  set the customkeys["tbRowData"] of grp "Table" to empty
  set the tbRowData["MyProperty"] of grp "table"  to SomeRowData
end  mouseup

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/

----- Original Message -----
From: "Tariel Gogoberidze" <PMDA at earthlink.net>
To: <metacard at lists.runrev.com>
Sent: Sunday, April 14, 2002 1:28 AM
Subject: CustomKeys behavior


> Mac OS 9.1  MetaCard  2.3  and up to the latest  build of 4.2B2
>
> I have a  group object with custompropertySET "tbRowdata"
>
> button a
> on mouseup
>   set the customkeys[tbRowData] of grp "Table" to empty
> end  mouseup
>
> button b
> on mouseup
>   set the tbRowData["MyProperty "] of grp "table"  to SomeRowData
> end  mouseup
>
> Clicking button "a" and then button  "b" works as  expected.
>
> However, if  you  put this two lines of script under  one button
> button c
> on mouseup
>   set the customkeys[tbRowData] of grp "Table" to empty
>   set the tbRowData["MyProperty"] of grp "table"  to SomeRowData
> end  mouseup
>
> The second line of script does not work and custompropertySET
> "tbRowdata" remains empty.
>
> I guess it could  be explained as perfectly normal  MC  behavior and I
> know that  I can  use
>
> on mouseUp
>   set the customPropertySet of grp "Table" to "tbRowData"
>   set the customProperties of grp "Table" to empty
>  -- set the customPropertySet of grp "Table" to empty
>   set the tbRowData["MyProperty"] of grp "table"  to SomeRowData
> end mouseUp
>
>  but while I'm learning  Associative  arrays  I sure wold like  to learn
> why script in button "c" is not working as I expected it to work.
>
> Also, MC 2.4.2  introduced  a very nice new feature
>
> "When the a field has a vertical grid, text is now truncated within a
> "cell" rather than being pushed off to the next tab stop location"
>
> However,  if you will create a field  with vertical grid   and  type
> following in button  script
>
> on mouseUp
>   set the tabstops of field  1 to "50,100,150"
>   put "this is the test" & tab & "this is the test" into fld 1
>   set itemdel  to tab
>   set the textcolor  of item 1 of fld 1 to red
> end mouseUp
>
> then the truncated  part of "this is the test"  will became  visible.
>
> BTW  till last moment  I  hoped that  the final  version of MC  2.4.2
> will introduce  three dots "и"  instead  of truncated  text. But it is
> in gamma  version already and no luck so far
>
> Best regards,
> Tariel  Gogoberidze
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>




More information about the metacard mailing list