10-07-2008 03:55 PM
hi
i want to assing values to alphabets from A to Z as 0-15. like a=0 ,b=1 and so on ,
so that vn ever i give any word string like BALL it is converted to 101212 which is numeric
so plz if sme1 can help me out i am new to Labview
maak
10-07-2008 04:08 PM - edited 10-07-2008 04:09 PM
The "String to Byte Array" function might more or less be what you're looking for. It converts a string to an array of U8 codes (ASCII codes). You can convert the string to lower/upper case before or subtract an offset from the result to better meet your needs.
http://zone.ni.com/reference/en-XX/help/371361D-01/glang/string_to_byte_array/
10-07-2008 04:12 PM - edited 10-07-2008 04:18 PM
You can try something along these lines here:
10-07-2008 04:12 PM - edited 10-07-2008 04:14 PM
maak,
Why not just use ASCII characters which are industry standard? See here for a table of ASCII characters. http://digital.ni.com/public.nsf/allkb/47CFD9C7682DCB2A86256FF800781EB7
Wow! Talk about being late for dinner.
10-07-2008 04:22 PM
SIR
i want to assign the fixed values from 0-25 to alphabets so wat ever is the input string it converts it to numbers as A to 0 b to 1 and if i write the sentence it convert it all in to number as the given values
thnx
10-07-2008 04:25 PM - edited 10-07-2008 04:29 PM
maak wrote:i want to assing values to alphabets from A to Z as 0-15. like a=0 ,b=1 and so on ,
so that vn ever i give any word string like BALL it is converted to 101212 which is numeric
This will not be very useful, because you cannot reverse the operation. 101111 could be BALL, JLL, BABBBB, JBBL, or many other variations. What is the purpose of this operation? Does it need to be reversible, or are you just trying to create a hash or similar?
It might make more sense to use 2 digits for each number, e.g. BALL=01001111. Please explain what you need.
10-07-2008 04:25 PM
10-07-2008 04:28 PM
10-07-2008 04:30 PM
10-07-2008 04:30 PM
yes sir u rite that is wat i want to do but i want to treat each alphabet spreatly than it will be more accurate