At 09:33 1/04/97 -0500, you wrote:
>There are several ways to do what I think you have in mind. The solution
>below does not use loops, which might be the most efficient in uncompiled
>versions of VEE.
>
>Convert your text to a number with a From String object containing:
>
> READ TEXT X INT
>
>Convert the output of the From String object back into a string of "1"s and
"0"s
>with a To String object containing:
>
> WRITE BYTE 48+(bit(a,8))
> WRITE BYTE 48+(bit(a,7))
> ...
> WRITE BYTE 48+(bit(a,0))
>
>If you needed the result in a numeric form, use another From String object.
>Hope this helps!
>
>Jim Kneale kneale.j.b@postal.essd.northgrum.com
>ph (410)765-3807 /// Northrop Grumman ESSD
>fax (410)993-8126 (..) Baltimore MD USA
>----------------ooO-()-Ooo------------------
>#include "std_disclaimer.h" //opinions are my own
>
>_________________________ Reply Separator _________________________________
Thanks for your help Jim,
In fact, I was thinking in which way I could convert a decimal or
hexadecimal number (or string which represent a number of these types) in
which the alarm of an equipment are codified, and then being able to
identify when and what alarm has been raised or cleared.
Thinking in several suggestions I have received I have realized that if I
write one TO STRING object, with the following transaction (where "a" is the
integer number to be converted):
WRITE TEST bit(a,31),bit(a,30),........,bit(a,0)
I get a string with 1s and 0s.
Regards,
______________________________________________________
Juan Carlos Martin
E-mail : jcmar@mdr.indra-espacio.es
Phone : 34-1-3963995
Fax : 34-1-3963912
Earth Stations Department
INDRA ESPACIO / MADRID /SPAIN
>There are several ways to do what I think you have in mind. The solution
>below does not use loops, which might be the most efficient in uncompiled
>versions of VEE.
>
>Convert your text to a number with a From String object containing:
>
> READ TEXT X INT
>
>Convert the output of the From String object back into a string of "1"s and
"0"s
>with a To String object containing:
>
> WRITE BYTE 48+(bit(a,8))
> WRITE BYTE 48+(bit(a,7))
> ...
> WRITE BYTE 48+(bit(a,0))
>
>If you needed the result in a numeric form, use another From String object.
>Hope this helps!
>
>Jim Kneale kneale.j.b@postal.essd.northgrum.com
>ph (410)765-3807 /// Northrop Grumman ESSD
>fax (410)993-8126 (..) Baltimore MD USA
>----------------ooO-()-Ooo------------------
>#include "std_disclaimer.h" //opinions are my own
>
>_________________________ Reply Separator _________________________________
Thanks for your help Jim,
In fact, I was thinking in which way I could convert a decimal or
hexadecimal number (or string which represent a number of these types) in
which the alarm of an equipment are codified, and then being able to
identify when and what alarm has been raised or cleared.
Thinking in several suggestions I have received I have realized that if I
write one TO STRING object, with the following transaction (where "a" is the
integer number to be converted):
WRITE TEST bit(a,31),bit(a,30),........,bit(a,0)
I get a string with 1s and 0s.
Regards,
______________________________________________________
Juan Carlos Martin
E-mail : jcmar@mdr.indra-espacio.es
Phone : 34-1-3963995
Fax : 34-1-3963912
Earth Stations Department
INDRA ESPACIO / MADRID /SPAIN
below does not use loops, which might be the most efficient in uncompiled
versions of VEE.
Convert your text to a number with a From String object containing:
READ TEXT X INT
Convert the output of the From String object back into a string of "1"s and "0"s
with a To String object containing:
WRITE BYTE 48+(bit(a,8))
WRITE BYTE 48+(bit(a,7))
...
WRITE BYTE 48+(bit(a,0))
If you needed the result in a numeric form, use another From String object.
Hope this helps!
Jim Kneale kneale.j.b@postal.essd.northgrum.com
ph (410)765-3807 /// Northrop Grumman ESSD
fax (410)993-8126 (..) Baltimore MD USA
----------------ooO-()-Ooo------------------
#include "std_disclaimer.h" //opinions are my own
_________________________ Reply Separator _________________________________
Subject: VEE Suggestions and a silly question
Author: Juan Carlos Martin <jcmar@mdr.indra-espacio.es> at BALT.SMTP
Date: 4/1/97 12:55 PM
On the other hand and falling from the Imaginary World to the Real World,
does somebody know (in a straightforward way, without making a function) how
to transform a integer number in a string with the binary value (1/0) of
that number?