LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Get ASCII code value of a complex string in CVI 6.0

Hello

Assuming a string which is composed of number , English letter and Chinese character , I want to get each charcter's ASCII value , and then add them together, how to process such a problem ? Thanks.

David
0 Kudos
Message 1 of 2
(3,365 Views)
David,

When you store strings in a buffer you actually have the ASCII value in the buffer. The string control is the one that replaces the ASCII value in the buffer with the actual character. All you need to do is something like this:


int result;
char buffer[100];

result = buffer[0] + buffer[1] + buffer[2];

This way result will hold the value of the sum of the 3 ASCII values for the string that you have.

I hope this helps,
let me know if you have any other question.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 2
(3,365 Views)