What sort of entity is MyString.char[0] ?

temp = "ABCDEFG"
put temp.char[0]
--"ABCDEFG"

This would seem like a frivolous question (I know that the first character 
in MyString is MyString.char[1]), except that when your insertion point is 
at the front of a text field, it is at position 0 (member.selection is [0, 
0]), and so this script, for instance, will fail, when the insertion point 
is at the beginning of the text:

InsPoint = member(x).selection[2]
StrText = member(x).text
put "ABCDEFG" after StrText.char[InsPoint]
member(x).text = StrText

So in a script like that, one has to test for StrText = 0, and use a 
different statement for inserting "ABCDEFG", if it is: put "ABCDEFG" before 
StrText.char[InsPoint].

The reason I'm writing is for conceptual clarification: why is

temp.char[0] = temp?

What's the wisdom or mechanism behind that?

Slava


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to