RE: Real simple question and TID's 'n AS
RE: Real simple question and TID's 'n AS
- Subject: RE: Real simple question and TID's 'n AS
- From: "Wallace, William" <email@hidden>
- Date: Fri, 8 Nov 2002 15:31:49 -0600
There's a semantical debate going on in the other thread (TID's 'n AS) about
whether the empty string is a default value for AS's TIDs or or merely a
"factory supplied" initial value. IMO, calling "" the default value of AS's
TIDS implies that if no value is specified for the current operation, then
"" will be used by default. This is not necessarily so if a previous
operation has changed the value to ":" or whatever. So it seems to me that
only reasonable way to proceed is to *always* set the TIDs to what you need
them to be for the next operation (even if that means setting them to ""
when they may well already be set to that value). Then it doesn't matter is
some previous operation has reset them to "" or not. In general, that seems
like all around good sense -- It's like making sure the TV is on the right
channel *before* you hit record on the VCR.
;-}
-whw
>
Message: 14
>
Date: Thu, 07 Nov 2002 20:56:54 +1100
>
Subject: Re: Real Simple Question ("null" isn't TID default)
>
From: David Lloyd <email@hidden>
>
To: <email@hidden>
>
>
Mark Myers commented...
>
>
> AppleScript's text item delimiters are the characters used to separate
>
> one text item from another. The default is "" (the null character)....
>
>
Ooooo that's not right - the default TID is nothing, i.e no charcter at
>
all.
>
Null is in fact a character, it's ascii number 0.
>
>
You shouldn't reset the delims to null, you should reset it to "".
>
>
(Null doesn't mean nothing.)
>
>
A null character can look like nothing in a script editor result but you
>
can
>
tell that a sub-32 ascii number character exists by moving the I-beam
>
cursor
>
along the resultant text by pressing the right-arrow on the keyboard.
>
>
Do this to the result of:
>
>
set x to "a" & (ASCII character 1) & "p" & (ASCII character 2) & "p" &
>
(ASCII character 3) & "l" & (ASCII character 4) & "e"
>
>
You'll see that the cursor appears to just stop then continue as you click
>
the cursor along.
>
>
So "" is not necessarily null, it could be any character less than ascii
>
number 32 (or it could in fact be nothing at all.)
>
>
-----
>
>
A lot of scripters reset the TIDs to a pre-gotten variable
>
(after typing an extra line of code to establish it):
>
>
set oldDelim to applescript's text item delimiters
>
--some code...
>
set applescript's text item delimiters to oldDelim
>
>
I've always wondered why not just do:
>
>
set applescript's text item delimiters to "" ?
>
>
It's less work... :)
>
>
-----
>
>
In many years, this has never failed...
>
>
Best regards,
>
>
David Lloyd
_______________________________________________
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.