Set the visible of

Klaus Major klaus at major-k.de
Tue Oct 28 03:42:34 EST 2003


Hi Thomas,

> --- Thomas J McGrath III <3mcgrath at adelphia.net>
> wrote:
>> I am trying to hide a set of text fields before the
>> card is opened and
>> then show them with a dissolve.
>> The fields are named myLabel1, myLabel2 etc to
>> myLabel8
>> It don't work.....
>>
>> on preOpenCard
>>   repeat with v = 1 to 8
>>      put quote & "myLabel" &v& quote into h
>>      set the visible of Field h to false
>>    end repeat
>> end preOpenCard
>>
>
> Hi Tom,
>
> I think the engine is looking for a field with a quote
> in its name. However, this gives me a chance to work
> the wonders of the 'merge' function again :-)
> Try the following script :
>
> --
> on preOpenCard
>   repeat with v = 1 to 8
>     put merge("field [[quote]]myLabel[[v]][[quote]]")
> \
>         into tFieldRef
>     set the visible of tFieldRef to false
>   end repeat
> end preOpenCard
> --
>
> Hope this helped,

and now a bit less irritating ;-) :

You end with 2 quotes around the name of the field like ""field1""
(I doubt that the name of your fields do have QUOTES in their names...)

Script this:

on preOpenCard
   repeat with v = 1 to 8
      set the visible of Field ("myLabel" & i) to false
    end repeat
end preOpenCard

Hope that helps...


Regards

Klaus Major
klaus at major-k.de
www.major-k.de



More information about the Use-livecode mailing list