convert strig to numbers

gjoisa

Active Member
Licensed User
Longtime User
Hi everybody !
Please let me know , how to convert a string having more than 8 charecters to a number containing same number of charecters .:sign0085:
 

gjoisa

Active Member
Licensed User
Longtime User
Sorry ! I haven't meant this one . What i meant is to convert a string having alphabets to numbers .
 

gjoisa

Active Member
Licensed User
Longtime User
My purpose is to generate a numeric key from device's owner's name .
 

taximania

Well-Known Member
Licensed User
Longtime User
As in A=1,B=2 etc
B A R R Y
2 1 18 18 25 ??

B4X:
Sub Globals
   'Declare the global variables here.
End Sub

Sub App_Start
   Form1.Show
   
End Sub


Sub Button1_Click
   c=""
   name=StrToUpper(textbox1.Text)
   For a = 0 To StrLength(name) -1
   b=StrAt(name,a)
   c=c & Asc(b)-64
   Next
   label1.Text=c
End Sub
 

Cableguy

Expert
Licensed User
Longtime User
Or you can use the ascii value of each alfanumeric chararcter...
This way you dont need to list all values prior to encode them...

In my password textbox, wich unfortunatly I don't have the cs file anymore, I used a very similar to taximania aproach..
declaring the alphabet backwards-....
 
Last edited:
Top