shrug-l: RE: ArcINFO bug???

Dietrich, Mark Mark.Dietrich at dep.state.fl.us
Wed Feb 15 10:30:33 EST 2006


The use of single or double quotes in variables generally has to be treated
carefully to avoid unintended consequences. I believe this is the way AML has
always treated characters as the code base for Arc/Info has been essentially
locked down since the 7.x releases.

The use of the QUOTE and UNQUOTE functions are generally used to pass strings
with imbedded spaces. If you try assigning this value to a variable without
quotes it will generally fail.

&echo &brief

&sv x = 'TEST 2' 

&if [unquote [quote %x%]] = 'TEST 2' &then &type (1) X is equal to TEST 2
 &else &type (1) X is not equal to TEST 2

&if %x% = 'TEST 2' &then &type (2) X is equal to TEST 2
 &else &type (2) X is not equal to TEST 2

&if [quote %x%] = 'TEST 2' &then &type (3) X is equal to TEST 2 
 &else &type (3) X is not equal to TEST 2

&echo &off
&return

Another interesting use of UNQUOTE is to pass a carriage return 
	[UNQUOTE '']

Mark Dietrich
Bureau of Watershed Management
Division of Water Resource Management
Florida Department of Environmental Protection
(850) 245-8550
mark.dietrich at dep.state.fl.us


-----Original Message-----
From: shrug-l-bounces at lists.dep.state.fl.us
[mailto:shrug-l-bounces at lists.dep.state.fl.us] On Behalf Of Tan, Yurong
Sent: Wednesday, February 15, 2006 9:49 AM
To: SHRUG
Cc: ESRI-L at ESRI.COM
Subject: shrug-l: RE: ArcINFO bug??? 


For those of you who are still using Arc/INFO AML to do things, you might
need to watch out for functionality changes that might have been implemented
inadvertently.  For example, a variable quoted by the [QUOTE ] function is
not the same as not quoted by the [QUOTE ] function.  For instance, the
following statements will produce different results (ArcInfo 9.0).  Among
other things, the quote function is often used to prevent a failure should
the variable is a null/empty or an incompatible type (e.g. a number in this
case).

&sv x = 'TEST' 

&if [quote %x%] = 'TEST' &then &type (1) X is equal to TEST &else &type (1) X
is not equal to TEST

&if %x% = 'TEST' &then &type (2) X is equal to TEST &else &type (2) X is not
equal to TEST




Yurong Tan, Ph.D., Program Analyst/GIS
PSSG - Field Unit of ADUSH for Policy and Planning Department of Veterans
Affairs
Tel:  352-374-6080 (x5382)
Fax: 352-374-6119
___________________________________
They all gave some and some gave all!
_______________________________________________
SHRUG-L mailing list
SHRUG-L at lists.dep.state.fl.us
http://lists.dep.state.fl.us/mailman/listinfo/shrug-l


More information about the SHRUG-L mailing list