> It is a number in string format. Given a record with optional fields, each
> bit in the binary string corresponds to a field in the record. For example,
> if the fifth field is included, the fifth bit in the binary number is set
> on. If the fifth field is not included, the fifth bit in the binary number
> is set off. This binary number is then converted to hex and sent at the
> beginning of the record. When I get a reply record back, I have to do the
> opposite...convert from hex to binary to determine which fields have been
> sent. I may not always have 16 bits...it depends on the record type that is
> sent. Different record types have a different number of fields.
* The simplest, and perhaps most efficient but error-prone method is:
m.lcInString = "C3D1"
m.lcOutString = ""
for m.lpCount = 1 to len(m.lcInString)
do case
case substr(m.lcInString,m.lpCount,1) = "0"
m.lcOutString = m.lcOutString + "0000"
case substr(m.lcInString,m.lpCount,1) = "1"
m.lcOutString = m.lcOutString + "0001"
case substr(m.lcInString,m.lpCount,1) = "2"
m.lcOutString = m.lcOutString + "0010"
case substr(m.lcInString,m.lpCount,1) = "3"
m.lcOutString = m.lcOutString + "0011"
case substr(m.lcInString,m.lpCount,1) = "4"
m.lcOutString = m.lcOutString + "0100"
etc.
endcase
endfor