74 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

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...