Re: Just submitted this to BugReporter as feature request - comments...
Re: Just submitted this to BugReporter as feature request - comments...
- Subject: Re: Just submitted this to BugReporter as feature request - comments...
- From: Graff <email@hidden>
- Date: Sun, 11 Apr 2004 01:17:41 -0400
On Apr 10, 2004, at 4:03 PM, Jim Witte wrote:
It would be SO nice if in Applescript I could simply write:
put 5 into tVar
put "set x to" && quote & tVar & quote && "+10" into tCommand
[...]
than the rather cumbersome (and much less Englishlike)
set tVar to 5 -- or equivalently 'copy 5 to tVar'
set tCommand to "set x to \"" & tVar & "\"+10"
[...]
Life would be so much easier for me if AppleScript would allow you to
set a variable simply by doing:
a = 5
I keep typing "set a to 5" when I'm programming in C and "a = 5" when
I'm programming in AppleScript.
I'm not saying get rid of the "set a to b" syntax but I think that "a =
b" should be an assignment statement rather than a test for equality.
However I realize that it would probably break too much stuff if it was
changed so I've just resigned myself to the inevitable errors when I
switch between programming in C/C++/Obj-C/Java/etc. and AppleScript
Not to mention the damn "if...then" statements. I can't begin to count
the number of times I've put the word "then" at the end of a C "if"
statement or forgotten it on the end of an AppleScript "if...then"
statement.
Heh, those two differences between the languages are the gotchas that
always catch me. It's too bad that the languages are so close in these
areas, if they had bigger differences they probably wouldn't trip me up
so much. Ahh well...
(grumbles something about most languages using a == b to test for
equality and a = b to assign values)
- Ken
_______________________________________________
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.