By: Paul S. Cilwa Viewed: 12/11/2018
Posted: 8/14/2018
Topics/Keywords: #Computers #Projects #Organica Page Views: 161
A place for oddball helper procedures and functions.

Any project needs a general module for random, code-saving utility functions. We're going to create such a module in this chapter and put a couple of starter procedures into it.

Call the module Utils.vb and enter the following two procedures.

Utils.vb (new)

Module Utils Public Sub ConCat(ByRef Buffer As String, ByVal AddThis As String) Buffer = Buffer & AddThis End Sub Public Function HTML_Encode(ByVal Value As String) As String Value = Value.Replace("--", "—") Value = Value.Replace("", "—") Value = Value.Replace(Chr(150), "—") Value = Value.Replace("", "é") Value = Value.Replace("""", """) Value = Value.Replace(ChrW(8220), """) Value = Value.Replace(ChrW(8221), """) Value = Value.Replace("'", "'") Value = Value.Replace("", "…") Value = Value.Replace("...", "…") Value = Value.Replace("", "½") Value = Value.Replace("", "¼") Value = Value.Replace("", "¾") Value = Value.Replace("", "ï") Value = Value.Replace("", "™") Value = Value.Replace("\", "&sor;") Return Value End Function End Module