Jump to content

Replace sign in string


Recommended Posts

"Num to String" or "Num to Ascii"?

If you are using an MI you could only possibly have 5 digits in your number 00.000 since the max value of an MI is 2^16.

Assuming you are using num to Ascii, you could just alter the high byte of the second MI in you ASCii array.

So if you went Num to Ascii into for example MI20, since the characters are byte packed your "." will be in the high byte of MI21 assuming you always keep it to three decimal places.

First do an AND with MI21 with hex 0F to "erase the "." and then just ADD hex 2C00 to MI21.

Link to comment
Share on other sites

"Num to String" or "Num to Ascii"?

If you are using an MI you could only possibly have 5 digits in your number 00.000 since the max value of an MI is 2^16.

Assuming you are using num to Ascii, you could just alter the high byte of the second MI in you ASCii array.

So if you went Num to Ascii into for example MI20, since the characters are byte packed your "." will be in the high byte of MI21 assuming you always keep it to three decimal places.

First do an AND with MI21 with hex 0F to "erase the "." and then just ADD hex 2C00 to MI21.

Mr Damian

I confuse the function names. You are correct, is Num to Ascii

Is possible you send me a example that you explain, please ?. I don´t found in help or example how use function " Replace String".

Many thanks.

post-1695-056680700 1316009175_thumb.jpg

Link to comment
Share on other sites

Damian

Many thanks for instrution and help. :-) Working perfectly.

Damian

You wrote : "Obviously this method would need to be modified if you change the decimal place."add

In the example, the vector size is 7 (D#7), (Function Number to AscII).. If i change to 8 (D#8), the function need too be changed to, right ?

I try understant what is the " 00FF" in the function AND. I believe it is about bit address or bit reference. What documentation i need read and studing for understand this ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...