Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Uwe Heyer" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: How setting enumerator in cavo code Date: 21 Sep 2014 23:49:26 GMT Lines: 56 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: individual.net 8DH35Rk5o2D7nOlJuz+aCga2vgZO9diGi4c6xKa6Up2zInyxGt Cancel-Lock: sha1:rjm+45WG/oeQzOgIJP7aLs4fhtM= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:7225 > My problem is how to set an enumerator into a structure > > In WinAPI they say: > typedef enum _STORAGE_BUS_TYPE { Hi Jean, an enum isn't a structure. It is an integer for VO. This INT can hold one and only one value of the underlying members. (see it like a UNION of INT's) e.g. typeded enum WEEK { Sunday = 1, // assigned first value, or zero if nothing assigned Monday, // +1 other days, // +1, or new value assigned Saturday // +1 == 7 } For one another language you can code something like WEEK day; day can hold the enum value from 1 to 7, nothing more day = GetDayOfWeek(Date()); // return enum 2 if ( day == Monday ) doThis(); VO Code day = GetDayOfWeek(Date()); // return 2 if day = 2 doThis() endif Ahoj -Uwe