815 views
in GUI Development by
Hello,
I want to define ENUM inside embedded wizard and to know how to use the ENUM in native function.

1 Answer

0 votes
by

Hello,

the C type definition representing enum is XEnum in native code. The enum items are C identifiers composed of the unit name, enum name and item name. For example, if you have an enum State defined within the unit Application and the enum contains an items named Disabled and Protected then following native code demonstrates the usage of the enums in C code:

var Application::State state = ...

native ( state )
{
   XEnum state_in_c = state;

  if ( state_in_c == ApplicationStetDisabled )
    state_in_c = ApplicationStateProtected;

  state = state_in_c;
}

trace state;

Generally, if you have doubts how to implement some native code as glue code between GUI and the device, the simplest is to analyze the generated code.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...