How do I Create a Custom Property

Klaus Major klaus at major-k.de
Wed Apr 21 12:56:19 EDT 2004


Hi David,

> ...
>> Sure it does.
>>
>> Try this.
>>
>> Set the myCustomProp of this stack to ""
>> put the myCustomProp of this stack into tTemp
>> put "This is line 1" into line (number of lines of tTemp + 1) of tTemp
>> set  the myCustomProp of this stack to tTemp
>>
>> OR
>>
>> Set the myCustomProp of this stack to "line 1"&cr&"line2"&cr&"line3"
>> put the myCustomProp of this stack into tTemp
>> put "This is line  4" into line (number of lines of tTemp + 1) of 
>> tTemp
>> set  the myCustomProp of this stack to tTemp
>
> This is basically what I was saying, the problem is that there if 
> there is just one
> entry in the Custom Properties, then it isn't always terminated with a 
> CR. So, doing
>
>> put "This is line 1" into line (number of lines of tTemp + 1) of tTemp
>
> would result on the line being appended to the last LINE not to the 
> container.

No, see below...

> Also from reading Klaus's posts, he seems to think that you are to put 
> the CR
> at the START of a line, means that if the container is empty, you need 
> to do a
> test for that and NOT prepend a return in this case!
>
> I am guessing that the problems I was having yesterday is because I 
> entered
> some custom props in the IDE which by the looks of it, doesn't add a 
> CR to the
> last item in the list.
> As long as everything is TERMINATED with a CR, then your code will 
> work ok (and so will mine!).

Sorry, i forgot this very special case of the "thinking" engine :-)

If you have an empty field or "list" (sic" ;-) and do:

put "blabla" into line 10 of fld "the one that is really empty"
or
put "blabla" into line 10 of myReallyEmptyListVar

The engines is "somehow" aware that the field or list is indeed empty 
and
will add the necessary CRs, until you have a field or list with 9 empty 
lines and
"blabla" in line 10 of that field or list...

Same applies if the field is not empty but holds less than 10 lines...

If the field or list already holds 10 or more lines (empty or not) the 
contents of line 10
will simply be replaced by "blabla"...

> All the Best
> Dave

Regards

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



More information about the use-livecode mailing list