[Gambas-user] ty
vlahonick vlahonick
tsopanotragi at ...67...
Tue Apr 14 15:21:26 CEST 2009
THANKS YOU ALL for your replies...
every anwser was very interesting but the simplest and best solution was Dominique's (special thanks).
here is the final code :
' Gambas class file
' Designed by Vlahonick
PUBLIC SUB _new()
END
PUBLIC SUB Form_Open()
END
PUBLIC SUB Button1_Click()
DIM S AS String
DIM i, y, N, d AS Integer
S = Textbox1.Text
y = Len(S)
IF y = 0 THEN RETURN
N = 0
FOR i = 1 TO y
d = Val(Mid(S, i, 1))
N += d * (2 ^ (y - i))
NEXT
Textbox2.Text = N
END
PUBLIC SUB Button2_Click()
ty all again , Vlahonick
textbox1.text = ""
TextBox2.text = ""
END
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
http://www.microsoft.com/windows/windowslive/products/photos.aspx
More information about the User
mailing list