I IslamQabel Active Member Licensed User Longtime User Jun 9, 2018 #1 Hi.. I am sending numbers from micro-controller as text and read it in my app as text, the question is...How to convert received numbers which is text to real number .. for example: send "12" and receive it as "12"...i want to convert it to 12 (number) which can be recognized by B4A as a number thanks
Hi.. I am sending numbers from micro-controller as text and read it in my app as text, the question is...How to convert received numbers which is text to real number .. for example: send "12" and receive it as "12"...i want to convert it to 12 (number) which can be recognized by B4A as a number thanks
DonManfred Expert Licensed User Longtime User Jun 9, 2018 #2 Code: Copy dim text as string = "12" dim value as int = text or maybe just Code: Copy dim value as int = "12" Upvote 0
Code: Copy dim text as string = "12" dim value as int = text or maybe just Code: Copy dim value as int = "12"
M Mahares Expert Licensed User Longtime User Jun 9, 2018 #3 IslamQabel said: .i want to convert it to 12 (number) Click to expand... Code: Copy Dim stVar As String="12" Dim intVar As Int =stVar Log(intVar) 'displays 12 Log(intVar/3) 'displays 4 Upvote 0
IslamQabel said: .i want to convert it to 12 (number) Click to expand... Code: Copy Dim stVar As String="12" Dim intVar As Int =stVar Log(intVar) 'displays 12 Log(intVar/3) 'displays 4
I IslamQabel Active Member Licensed User Longtime User Jun 9, 2018 #4 note that the received text is not fixed value...it can be any number let say: dim y as string y=Label1.text i want to convert the received text to recognized number by B4A, the received text is random not fixed value Upvote 0
note that the received text is not fixed value...it can be any number let say: dim y as string y=Label1.text i want to convert the received text to recognized number by B4A, the received text is random not fixed value
DonManfred Expert Licensed User Longtime User Jun 9, 2018 #5 Code: Copy dim y as string y=Label1.text dim value as int = y Upvote 0
Sandman Expert Licensed User Longtime User Jun 9, 2018 #6 Relevant tutorial: Variables & Objects in Basic4android (look for "Casting") Upvote 0
I IslamQabel Active Member Licensed User Longtime User Jun 9, 2018 #7 thanks for all members who helped me works good Upvote 0