There is something strange with code below --got it from the forum
------------------------------------------------------------------
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Label1 As Label
Dim Label2 As Label
Dim txt As String
Dim CCT As ClickableTV
End Sub
-----------------------------------------------
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("ClickableTVLayout")
txt = File.GetText(File.DirAssets, "text.txt")
arrWord = Regex.Split(" ", txt)
For k = 0 To arrWord.Length - 1
CCT.AddLinkText(Label2,arrWord( k ).Trim ,Colors.White,"GetString")
Next
End Sub
--------------------------------------------------------------------------
Sub GetString_clickablelink (Text As String)
Label3.Text = Text
End Sub
--------------------------------------------------------------------------
With this code, the text is loaded to the label but not spaced out properly. If I add an extra space inside the quotation mark in code line
arrWord = Regex.Split(" ", txt)
the text is displayed properly but messes up the click
Without the extra space I can click on a word and that word only is displayed in Label1.
When I add extra space for proper display, instead of the word clicked being displayed in Label1, all the text loaded to Label2 would be displayed in Label1.
Pls how can I fix this? I want properly spaced out text in Label2 and have ability to click a word and display it in Label1.
Thanks
------------------------------------------------------------------
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Label1 As Label
Dim Label2 As Label
Dim txt As String
Dim CCT As ClickableTV
End Sub
-----------------------------------------------
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("ClickableTVLayout")
txt = File.GetText(File.DirAssets, "text.txt")
arrWord = Regex.Split(" ", txt)
For k = 0 To arrWord.Length - 1
CCT.AddLinkText(Label2,arrWord( k ).Trim ,Colors.White,"GetString")
Next
End Sub
--------------------------------------------------------------------------
Sub GetString_clickablelink (Text As String)
Label3.Text = Text
End Sub
--------------------------------------------------------------------------
With this code, the text is loaded to the label but not spaced out properly. If I add an extra space inside the quotation mark in code line
arrWord = Regex.Split(" ", txt)
the text is displayed properly but messes up the click
Without the extra space I can click on a word and that word only is displayed in Label1.
When I add extra space for proper display, instead of the word clicked being displayed in Label1, all the text loaded to Label2 would be displayed in Label1.
Pls how can I fix this? I want properly spaced out text in Label2 and have ability to click a word and display it in Label1.
Thanks