791 views
in Embedded Wizard Studio by

version 6.5

I want to display some fault codes on the screen in hexadecimal mode.

can  Views::Text + string() do that? and how?

Does the string function support format conversion?

 

 

 

 

1 Answer

0 votes
by
 
Best answer

Hello,

with the version 8.20 we have enhanced the set of string() instant constructors to do what you expect. This however is not available in the old version 6.50. You have two possibilities:

Option 1: Update to the newest version (actually 9.10).

Option 2: Implement your own format function in Chora to convert a number in HEX string. The following example demonstrates it:

var uint32 number = ...
var string digits = "0123456789ABCDEF";
var string result = "";

while (( number != 0 ) || ( result.length == 0 ))
{
  result = digits[ int32( number & 0xF )] + result;
  number = number >> 4;
}

return result;

Best regards

Paul Banach

by

That's very useful. Thank you very much for your answer.

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

...