Alright so i made this add sub to add text with formatting and also to highlight any url's in the text and it works except i have to put a space at the end of every new line and i cant seem to fit it lol, so here is the code hope someone can make use of it and possibly figure out how to fix the space issue. The isStart function is also included.
PUBLIC SUB Add(Text AS String, OPTIONAL TextColor AS Integer, OPTIONAL bBold AS Boolean)
DIM strWords AS String[]
DIM i AS Integer
DIM strWord AS String
DIM strCheck AS String
strWords = Split(Text, " ")
FOR i = 0 TO strWords.Count - 1
strWord = strWords[i]
strCheck = LCase(strWord)
IF ModMain.isStart(strCheck, "http://") OR ModMain.isStart(strCheck, "https://") OR ModMain.isStart(strCheck, "ftp://") OR ModMain.isStart(strCheck, "irc://") OR ModMain.isStart(strCheck, "telnet://") OR ModMain.isStart(strCheck, "mailto:") THEN
teLog.Select(String.Len(teLog.Text), 0)
teLog.Format.Color = Color.RGB(0, 0, 168)
teLog.Format.Font.Underline = TRUE
IF bBold = TRUE THEN teLog.Format.Font.Bold = TRUE
teLog.Insert(strWord & " ")
ELSE
teLog.Format.Color = TextColor
IF bBold = TRUE THEN teLog.Format.Font.Bold = TRUE
teLog.Insert(strWord & " ")
END IF
NEXT
teLog.Insert("\n")
END
PUBLIC FUNCTION isStart(inputText AS String, searchFor AS String) AS Boolean
IF Mid(inputText, 1, Len(searchFor)) = searchFor THEN
RETURN TRUE
ELSE
RETURN FALSE
END IF
END