Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #7227

Re: How setting enumerator in cavo code

From <jean_ray67@hotmail.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: How setting enumerator in cavo code
Date 2014-09-21 23:52 -0400
Organization A noiseless patient Spider
Message-ID <lvo6dm$98n$1@dont-email.me> (permalink)
References <lvmpum$7fr$1@dont-email.me> <c896g6F41apU1@mid.individual.net>

Show all headers | View raw


Uwe Heyer

Thank for your answer...

The problem is if I put the member [BusType] as int, it returns = 302350336 
(0x12058000)

If I put it as dword, it returns  also = 302350336 (0x12058000)

if I put it as shortint, it return = -32768 (0xFFFF8000)

if I put it as word, it return = 32768 (0x8000)

If i put it as BYTE , it returns = 0  (0x00)

The return value should be... [ BusTypeUsb                = 0x7,]

What the hell i am doing wrong?

Jean Raymond
rayonline.com

//////

"Uwe Heyer"  wrote in message news:c896g6F41apU1@mid.individual.net...

> 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










Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How setting enumerator in cavo code <jean_ray67@hotmail.com> - 2014-09-21 11:13 -0400
  Re: How setting enumerator in cavo code "Uwe Heyer" <uwe.heyer@aristik.de> - 2014-09-21 23:49 +0000
    Re: How setting enumerator in cavo code "Uwe Heyer" <uwe.heyer@aristik.de> - 2014-09-22 00:18 +0000
    Re: How setting enumerator in cavo code <jean_ray67@hotmail.com> - 2014-09-21 23:52 -0400
      Re: How setting enumerator in cavo code "Uwe Heyer" <uwe.heyer@aristik.de> - 2014-09-22 15:32 +0000
  Re: How setting enumerator in cavo code Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2014-09-22 10:19 +0100

csiph-web