374 views
in Embedded Wizard Studio by
Currently I migrated our project to embwiz version 13.02 from version 10

then some code optimization is happening

example :

Have below code in embedded wizard

var string name = "";

$if !$prototyper && ( $platform != *.WebGL.* ) && ( $platform != *.Win32.* )
native
{
  BYTE pName[32];
  BYTE length = sizeof(pName);
  name = EwNewStringUtf8( productName, PNameLength );
}
$else
    name = "name";
$endif

return name;

 

Generated code is in below

XString DeviceDeviceClass_OnGetProductName( DeviceDeviceClass _this )
{
  /* Dummy expressions to avoid the 'C' warning 'unused argument'. */
  EW_UNUSED_ARG( _this );

  {
    BYTE pName[32];
    BYTE length = sizeof(pName);
    name = EwNewStringUtf8( productName, PNameLength );
  }
  return 0;
}

String variable name is removed from generated code,

How to solve this issue?

 

Thank you

1 Answer

0 votes
by
 
Best answer

Hello,

please ensure that all Chora variables used inside the native code are listed in the native statement. For example native( name ) { ... }.

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

...