RE: TIDs default in AS is {""}
RE: TIDs default in AS is {""}
- Subject: RE: TIDs default in AS is {""}
- From: "Wallace, William" <email@hidden>
- Date: Mon, 11 Nov 2002 11:09:07 -0600
I disagree with your analysis.
>I think it's a question of personal definition whether
AppleScript's text
>item delimiters has a default value....
>Some would argue that there is no default because it doesn't
initially
>exist.
But it does initially exist. Every time you launch Script Editor or a script
application the value of AS's TIDs reverts to the empty string. (AppleScript
Language Guide P.211)
>And some might say that a zero length string would be still be
regarded as a
>string.
Every beginning programming book or tutorial (regardless of what programming
language) that I have seen, has included the concept of an "empty string" in
it's initial definition and discussion of strings. I think a zero-length
string is pretty much a universally accepted programming construct.
>Now when I first launch the Script Editor, and before I do anything
else,
>the result of this line...
>class of AppleScript's text item delimiters
>...is list (actually a 1 item list of a zero length string).
yeah... so...
>So, if I use the correct dictionary definiton of the word
"default", I can
>conclude that:
>The default of AppleScript's text item delimiters is: {""}
Which correct dictionary definition is that? Merriam-Webster gives us this:
1 : failure to do something required by duty or law : NEGLECT
2 archaic : FAULT
3 : failure to pay financial debts
4 : failure to appear at the required time in a legal proceeding
5 : a selection automatically used by a computer program in the absence of a
choice made by the user
Initially, definition 5 seems to support your statement. If I try to get
text item 1 of "abcde" without explicitly choosing a value for AppleScript's
text item delimiters, the result ("a") is predictable. Furthermore, If I
choose to set AppleScript's text item delimiters to a value other than ""
(say, for instance "c") and then get text item 1 of "abcde", the result
("ab") would also seem to support your statement. However, If I then try to
get text item 2 of "abcde" without explicitly choosing a value for
AppleScript's text item delimiters the result will be "de". This is contrary
to what Merriam-Webster says we should get if AppleScript's text item
delimter's *default* value is "".
Now, definition 1 (failure to do something required by duty or law :
NEGLECT) seems more apropos to the current debate. Whether it is our *duty*
to reset AppleScript's text item delimiters to their previous value after we
are finished using them. In this case the default value would refer to the
value of AS's TIDs if they *haven't* been reset, so any value *other* than
"" would be the default.
;-}
whw
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.