Hello
What I like to do is to send and receive a string with the RS232 port.
That’s no problem at all.
I would like to fill a string as in Basic A$= A$+ STR$(Value)
and read the value back in the string like Value=ASC(Mid$(A$,nr,1))
With other words,
how can I read a character like “A” back as a value 65 in a string.
or store the value 65 as “A” in the string
Please, can someone help me with this problem.
Thanks
String problem
Moderator: Benj
- Steve
- Matrix Staff
- Posts: 3421
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: String problem
In Flowcode, a string is essentially an array of bytes. So if you have a variable MyString = "ABC", then you can reference each character in the string is a calculation icon using square brackets, so MyString[0] is 'A' which equals 65 and MyString[2] is 'C' which equals 67.
If you had MyString[2] = 88 in a calculation icon, this would change the string MyString to "AXC".
I hope this helps.
If you had MyString[2] = 88 in a calculation icon, this would change the string MyString to "AXC".
I hope this helps.
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: String problem
Hello all
If you had MyString[2] = 88 in a calculation icon, this would change the string MyString to "AXC".
correct is:
If you had MyString[1] = 88 in a calculation icon, this would change the string MyString to "AXC".
Regards Wolfgang
If you had MyString[2] = 88 in a calculation icon, this would change the string MyString to "AXC".
correct is:
If you had MyString[1] = 88 in a calculation icon, this would change the string MyString to "AXC".
Regards Wolfgang