[quote=79832:@BO CHEN]Does it possible for an URL in a string? I know msgbox is not an option. If I really want to have a url embeded into a string, what I can do?
For example, it’s quite common in a “About” window to have the website link in a detailed description text. User can click the URL to open an default web browser to view the website. How can I do that?
In VB.NET the RichTextBox has an option to choose URL detectable or not, dose xojo has the similar function or not? [/quote]
Here is code you place in a textArea SelChange event :
Sub SelChange()
dim character, zurl as string
dim position as integer = Me.SelStart
dim beginning, ending as integer
while character<>" " and character <> EndOfLine and character <> chr(13) and position >Me.SelStart-150 _
and position >1
character = Mid(Me.Text,position,1)
position = position-1
wend
beginning = position+2
position = Me.SelStart
character = “”
while (character<>" ") and character <> EndOfLine and character <> chr(13) and position < Me.SelStart+150 _
and position <len(Me.Text)
character = Mid(Me.Text,position,1)
position = position+1
wend
ending = position-1
zurl = Mid(Me.text,beginning,ending-beginning)
msgbox zurl
'other types of url can be added if needed
if left(zurl,7) = “http://” or left(zurl,8) = “https://” or left(zurl,7) = “mailto:” then
ShowURL(zurl)
end if
End Sub
You can create a TextArea class with this event added, and all your TextAreas will have URL detection 