Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Script object compile error

Script object compile error
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2002
Location: Lancaster, CA
Status: Offline
Reply With Quote
Mar 27, 2002, 12:17 PM
 
I hope this is the right forum to post this to. If not, please direct me to the best forum.

The following script is directly from the AppleScript Language Guide from Apple Computer:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>on makePoint( x, y )
script point
property xCoordinate:x
property yCoordinate:y
end script
return point
end makePoint

set myPoint to makePoint(<font color = blue>10</font>, <font color = blue>20</font>)
get xCoordinate of myPoint
get yCoordinate of myPoint</font>[/code]

Attempting to compile this script brings up the error:

Expected "end" but found "property"

and highlights the word property the line property xCoordinate:x

If I edit the line that says script point to say just script instead of script point, the script compiles without trouble.

Am I doing something wrong or is the manual off?

Thanks,
Chuck
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Mar 27, 2002, 02:09 PM
 
Originally posted by Merdyn:
<STRONG>Attempting to compile this script brings up the error:

Expected "end" but found "property"

and highlights the word property the line property xCoordinate:x

If I edit the line that says script point to say just script instead of script point, the script compiles without trouble.

Am I doing something wrong or is the manual off?

Thanks,
Chuck</STRONG>
It appears that "point" is now a global variable like pi or current date. Just change the word "point" to anything else like "myPoint" and it should work fine
     
Merdyn  (op)
Fresh-Faced Recruit
Join Date: Feb 2002
Location: Lancaster, CA
Status: Offline
Reply With Quote
Mar 27, 2002, 02:17 PM
 
Synotic,

Thanks! That was what the problem was.

Chuck
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:26 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2