AnsweredAssumed Answered

VRf: enums and executables

Question asked by VRFuser on Aug 19, 1997
Hi Tom,

Thanks for your input.  I ended up writing a function that takes an integer
and returns a text value chosen from a text constant array.  It's not quite
what you suggested, but I wouldn't have thought of it without your email.
In fact, I don't quite understand what you did suggest.  If I put all my
text strings through the LIST object, can I then (in other objects)
directly compare integer variables and outputs to the text strings?

Emily

At 08:05 AM 8/19/97 PST8, you wrote:
>        2)  This is a bit of a problem in VEE, but not too hard to work
around. 
>     The only objects that produce ENUMs are LIST objects.  So to, say,
set an
>     ENUM field of a record, you have to have a LIST object with the
enumerated
>     list in question to produce the input.  Feed a text value
corresponding to
>     one of the ENUM values into the LIST through a DEFAULT VALUE control
pin,
>     and the Text will become an ENUM.  I think it would be nice if you
could
>     select an ENUM from a list with an index value, but that is not the
way it
>     works. 
>        ** One caveat is that if the input text value doesn't correspond
to a
>     value in the ENUM list, the program will error out.  This is one case
in
>     which having an ERROR output pin will not help though.  Even with an
ERROR
>     output, the program will stop, not trap the error to the pin.  So you
must
>     take measures to assure that the text value exactly corresponds to
one of
>     the LIST values.  I often set these with a TEXT CONSTANT (array) that
>     defines the list, then use an index to select a value from the list
in a
>     FORMULA box; ie. Ary[Index].  Another way is to loop through the list
array
>     and verify that a corresponding value exists before feeding it to the
LIST
>     box. - you can trap your own errors, but looping tends to be slow.
>    
>     Tom Groleau
>     HMSC, Tucson, Az, USA
>     trgroleau@ccgate.hac.com
>
>
>______________________________ Reply Separator
_________________________________
>Subject: VRf:  enums and executables
>Author:  Emily Giambalvo <emily@rupture.ucsc.edu> at CCGATE
>Date:    8/18/97 3:45 PM
>
>2.  How do you define enums for use outside of a selection control object?
>Does an enumerated list already exist for the VEE error codes?
>
>***********************************************************
>
>Emily Giambalvo

>Earth Science Dept.  tel:(408)459-2838
>University of California fax:(408)459-3074
>1156 High St.
>Santa Cruz, CA 95064
>
>
>
>
>

***********************************************************

Emily Giambalvo     
          
Earth Science Dept.          tel:(408)459-2838     
University of California     fax:(408)459-3074
1156 High St.
Santa Cruz, CA 95064



Outcomes