[python-win32] VBScript compilation error - expected end of statement
eric.powell@srs.gov
eric.powell at srs.gov
Mon Nov 7 17:50:57 CET 2005
Frank-
How are you trying to run the script?
Are you trying to use a front-end through ArcTool box, running it from the
command line, or running it in PythonWin?
All three should be roughly equivalent, however, it sounds like you trying
to Access the script the Toolbox or Model Builder and ArcGIS is
interpreting the script as being a VBScript and not python.
Send me a private e-mail and we can discuss this some more (and I will
bring my training materials to the office tommorrow), but I don' t think
this is an issue for the general list, as it is an ESRI issue and not a
Python issue.
HTH-
Eric
Eric B. Powell
Bechtel Savnnah River Inc.
(803) 557-6612
"Frank Peacock" <fepeacock at bulldoghome.com>
Sent by: python-win32-bounces at python.org
11/07/2005 10:34 AM
Please respond to
fepeacock at bulldoghome.com
To
<python-win32 at python.org>
cc
Subject
[python-win32] VBScript compilation error - expected end of statement
Hello
I am running a python script which calls an ESRI ArcGIS COM function
called
calculatefield. If the text variable I pass to this function is longer
than
10 characters I get the following error: "Microsoft VBScript compilation
error - expected end of statement". I do not know what I need to do to
solve
this problem. I have installed the latest WSH 5.6 but to no avail.
The following is my code:
#
--------------------------------------------------------------------------
-
# Create Time Field.py
# Created on: Sun Nov 06 2005 11:37:26 PM
# (generated by ArcGIS/ModelBuilder)
#
--------------------------------------------------------------------------
-
# Import system modules
import sys, string, os, win32com.client
# Create the Geoprocessor object
gp = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")
gp.SetProduct("ArcView")
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data
Management
Tools.tbx")
# Local variables...
gp.workspace = "C:\\GIS_DATA\\Satellite\\CLAUS\\I2-235\\"
try:
fas=gp.ListFeatureClasses("*","POLYGON")
fas.reset()
fa=fas.next()
while fa:
text=fa[0:11]
print text
# Process: Calculate Field...
gp.CalculateField_management(fa, "Time", text)
fa=fas.next()
except:
gp.AddMessage(gp.GetMessages(2))
print gp.GetMessages(2)
---
[This E-mail has been scanned for viruses but it is your responsibility
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]
_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20051107/ff5f949a/attachment.htm
More information about the Python-win32
mailing list