Re: offset with spaces confusion
Re: offset with spaces confusion
- Subject: Re: offset with spaces confusion
- From: Arthur J Knapp <email@hidden>
- Date: Fri, 03 May 2002 10:57:59 -0400
>
From: email@hidden
>
Subject: offset with spaces confusion
>
Date: Fri, 3 May 2002 11:24:11 +0100
>
ignoring white space
>
"abc" is in "a b c d"
>
-->true
>
I get the answer I expected. So why don't I get the answer I expect with
>
offset:
>
ignoring white space
>
offset of "c" in "a b c d"
>
-->8
I'm not sure what answer you want. 4?
>
I assume this means offset ignores the ignoring statement. Is there a
>
logical reason or is this a bug?
While I'm not sure about the usefulness of finding an offset while
ignoring whitespace, it would be nice if "offset of" worked with
some of the other considering/ignoring statements, like case,
diacriticals, and expansion, (especially case).
The "offset of" command is a part of the Standard Additions Scripting
Addition. Like many scripting addition commands, it doesn't seem to know
or care about considering/ignoring statements. This may be a basic flaw
with the whole osax system in general, I don't know. What I do know,
however, is that there are several things that the AppleScript development
team should consider for the future:
The following commands of Standard Additions should be directly brought
into the native AppleScript language for reasons of speed, (these are the
commands that are likely to be called repeatedly during a script run):
ASCII character, ASCII number, offset of, random number, round,
info for, and list folder.
"Offset of" should either be directly brought into the language and
be made to consider the consider/ignore statements, OR the osax command
should at least have an ignore-case parameter.
If the ascii commands are not going to be brought into the language,
then they should be re-written to accept and return strings and lists
of integers to process all at once:
ASCII characters {65, 66, ...} --> "AB..."
ASCII numbers "Hello World" --> { 72, 101, ... }
P.S. The round command should be replaced by Nigel Garvey's aRounderRound:
<
http://files.macscripter.net/ScriptBuilders/ScriptTools/aRounderRound.hqx>
soon to be at version 1.1 :)
P.P.S. By the way, the display-dialog and the choose-from-list commands
should allow the user to specify the use of a monospaced font, it
would really help me out on a project I am working on. ;-)
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://homepage.mac.com/ewalet/DeskTop.html>
on error number -128
end try
}
_______________________________________________
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.