Hello group,
I have encountered something that I cannot figure out. I have a piece of equipment that sends data via RS-232 to my computer.
I can receive it ok and it is saved as a string similar to this
Stack=3 Ask=1 Base=0.0 Ast="Mary Smith(201)" Bst="Jim Smith(202)" [Jim Smith(202)] AstNum=202 (Jim Smith) BstNum=201 (Mary Smith)
What I am trying to do is to parse out each section of the string and hopefully use it as an actual Variable.
That is, parse out say Stack=3 and use that as a variable named Stack with a value of 3 in my program.
In the past I have used the VB6 Split at each SPACE and put everything into an array. However, in this case there are spaces in the names, so that does not work for me.
I have also used Instr and Mid$ (in the past) to parse other strings similar to this but not quite the same.
It would be nice if there were a more elegant and efficient way to parse the string and preserve the names and values.
I have used Google for many years to find examples and lessons on other areas of VB6, but I just can't find anything that leads me to a solution for this.
Perhaps there is some type of "Sting to Variable" function/Method.
Thanks in advance....
I have encountered something that I cannot figure out. I have a piece of equipment that sends data via RS-232 to my computer.
I can receive it ok and it is saved as a string similar to this
Stack=3 Ask=1 Base=0.0 Ast="Mary Smith(201)" Bst="Jim Smith(202)" [Jim Smith(202)] AstNum=202 (Jim Smith) BstNum=201 (Mary Smith)
What I am trying to do is to parse out each section of the string and hopefully use it as an actual Variable.
That is, parse out say Stack=3 and use that as a variable named Stack with a value of 3 in my program.
In the past I have used the VB6 Split at each SPACE and put everything into an array. However, in this case there are spaces in the names, so that does not work for me.
I have also used Instr and Mid$ (in the past) to parse other strings similar to this but not quite the same.
It would be nice if there were a more elegant and efficient way to parse the string and preserve the names and values.
I have used Google for many years to find examples and lessons on other areas of VB6, but I just can't find anything that leads me to a solution for this.
Perhaps there is some type of "Sting to Variable" function/Method.
Thanks in advance....