convert strig to numbers

Discussion in 'Questions (Windows Mobile)' started by gjoisa, Feb 7, 2009.

  1. gjoisa

    gjoisa Active Member Licensed 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:
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Basic4ppc converts strings to numbers automatically.
    For example the following code works fine:
    Code:
    Sub App_Start
        a = 
    "123456789"
        
    Msgbox(a+1)
    End Sub
     
  3. gjoisa

    gjoisa Active Member Licensed User

    Sorry ! I haven't meant this one . What i meant is to convert a string having alphabets to numbers .
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Can you give a small example?
     
  5. gjoisa

    gjoisa Active Member Licensed User

    My purpose is to generate a numeric key from device's owner's name .
     
  6. taximania

    taximania Well-Known Member Licensed User

    As in A=1,B=2 etc
    B A R R Y
    2 1 18 18 25 ??

    Code:
    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
     
  7. Cableguy

    Cableguy Expert Licensed 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: Feb 7, 2009
  8. gjoisa

    gjoisa Active Member Licensed User

    Thank you all . That is what exactly I meant .
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice