Dim InputText As String = Me.txtenter.Text Dim Letters = From c As Char In InputText.ToCharArray Select c & " = " & AscW(c) & " " Me.lblanswer.Text = String.Join("", Letters.ToArray)
The above code is to convert each letter in a word or phrase (including the space) to its own binary code (For example: the letter "A"'s binary code is 65).
I tested this code at home, and it works perfectly well. But when I come to school, I wrote the exact same thing, but it does not work. Here is what it said:
Dim Letters = From c As Char In InputText.ToCharArray Select c & " = " & AscW(c) & " "
---> "End of statement expected" (I raelly don't know what end statement it needs)
Then, the second thing in error is:
Me.lblanswer.Text = String.Join("", Letters.ToArray)
---> the word "Letters" is underlined and it said: Letters is not declared yet.
Howcome this code works well at my PC but in school it reports those 2 errors?
If there is something that needs to be fixed, can you guys show me what is is and the way to fix it?
Thank you for your time!
Edited 6 Years Ago by TommyTran: n/a