Option Public
Option Explicit
Option Compare Nocase
Dim inCommentBlock As Integer
Dim inQuoteBlock As Integer
Dim quoteEndChar As String
Dim datatypes List As String
Dim operators List As String
Dim keywords List As String
Dim statements List As String
Dim functions List As String
Dim constants List As String
Dim classes List As String
Dim wordEndChars As String
Const OUTPUT_INLINE_STYLE = 0
Const OUTPUT_CSS = 1
Const OUTPUT_TAGS = 2
Type StyleDef
script As String
comment As String
quote As String
datatype As String
operator As String
keyword As String
statement As String
function As String
constant As String
class As String
End Type
Const OPEN_COMMENT_BLOCK = "%REM"
Const CLOSE_COMMENT_BLOCK = "%END REM"
Const CLOSE_COMMENT_BLOCK2 = "%ENDREM"
Const SCRIPT_STYLE = "lotusscript"
Dim START_SCRIPT As String
Dim END_SCRIPT As String
Const COMMENT_STYLE = "ls-comment"
Dim START_COMMENT As String
Dim END_COMMENT As String
Const QUOTE_STYLE = "ls-quote"
Dim START_QUOTE As String
Dim END_QUOTE As String
Const DATATYPE_STYLE = "ls-datatype"
Dim START_DATATYPE As String
Dim END_DATATYPE As String
Const OPERATOR_STYLE = "ls-operator"
Dim START_OPERATOR As String
Dim END_OPERATOR As String
Const KEYWORD_STYLE = "ls-keyword"
Dim START_KEYWORD As String
Dim END_KEYWORD As String
Const STATEMENT_STYLE = "ls-statement"
Dim START_STATEMENT As String
Dim END_STATEMENT As String
Const FUNCTION_STYLE = "ls-function"
Dim START_FUNCTION As String
Dim END_FUNCTION As String
Const CLASS_STYLE = "ls-class"
Dim START_CLASS As String
Dim END_CLASS As String
Const CONSTANT_STYLE = "ls-constant"
Dim START_CONSTANT As String
Dim END_CONSTANT As String
Function ConvertFile (fileName As String, outFileName As String) As Integer
Dim style As StyleDef
Call GetDefaultLsStyleDef(style)
ConvertFile = ConvertFileEx(fileName, outFileName, style, True)
End Function
Function ConvertFileEx (fileName As String, outFileName As String, style As StyleDef, useCSS As Integer) As Integer
Dim inFile As Integer
Dim outFile As Integer
Dim rawLS As String
Dim convertedLS As String
On Error Goto displayError
inFile = Freefile()
Open fileName For Input As inFile
outFile = Freefile()
Open outFileName For Output As outFile
Call ResetGlobals()
Call ResetStyleInfo(style, useCSS)
If Not (useCSS = OUTPUT_TAGS) Then
Print #outFile, "<html><head>"
Print #outFile, "<title>" & fileName & " (converted by ls2html)</title>"
If (Abs(useCSS) = OUTPUT_CSS) Then
Print #outFile, "<style>" & StyleDefToString(style) & "</style>"
End If
Print #outFile, "</head>"
Print #outFile, "<body>"
End If
Print #outFile, START_SCRIPT
While Not Eof(inFile%)
Line Input #inFile, rawLS
Print #outFile, ConvertLine(rawLS)
Wend
Print #outFile, END_SCRIPT
If Not (useCSS = OUTPUT_TAGS) Then
Print #outFile, "</body>"
Print #outFile, "<p><hr><center>"
Print #outFile, "ls2html was brought to you by <a href='http://www.nsftools.com'>nsftools.com</a></center>"
Print #outFile, "</body>"
Print #outFile, "</html>"
End If
Close inFile, outFile
ConvertFileEx = True
Exit Function
displayError:
Messagebox "Error " & Err & " Converting LS File: " & Error
ConvertFileEx = False
Exit Function
End Function
Function ConvertString (ls As String) As String
Dim style As StyleDef
Call GetDefaultLsStyleDef(style)
ConvertString = ConvertStringEx(ls, style, False)
End Function
Function ConvertStringEx (ls As String, style As StyleDef, useCSS As Integer) As String
Dim lineTerm As String
Dim tempString As String
Dim lastPos As Integer
Dim pos As Integer
On Error Goto displayError
Call ResetGlobals()
Call ResetStyleInfo(style, useCSS)
lineTerm = GetLineTerminator(ls)
ConvertStringEx = START_SCRIPT
lastPos = 1
pos = Instr(lastPos, ls, lineTerm)
While(pos > 0)
tempString = Mid$(ls, lastPos, pos - lastPos)
ConvertStringEx = ConvertStringEx & ConvertLine(tempString) & lineTerm
lastPos = pos + Len(lineTerm)
pos = Instr(lastPos, ls, lineTerm)
Wend
tempString = Mid$(ls, lastPos)
ConvertStringEx = ConvertStringEx & ConvertLine(tempString)
ConvertStringEx = ConvertStringEx & END_SCRIPT
Exit Function
displayError:
Messagebox "Error " & Err & " Converting LS String: " & Error
Exit Function
End Function
Function ConvertLine (Byval ls As String) As String
Dim i As Integer
Dim thisChar As String
Dim thisWord As String
Dim fooString As String
If (Trim(ls) = "") Then
ConvertLine = ls
Exit Function
End If
Call ConvertInvalidHTML(ls)
If (Left$(ls, Len(OPEN_COMMENT_BLOCK)) = OPEN_COMMENT_BLOCK) Then
ConvertLine = ConvertLine & START_COMMENT & ls
inCommentBlock = True
Exit Function
End If
If (inCommentBlock) Then
If ((Left$(SuperTrim(ls), Len(CLOSE_COMMENT_BLOCK)) = CLOSE_COMMENT_BLOCK) Or _
(Left$(SuperTrim(ls), Len(CLOSE_COMMENT_BLOCK2)) = CLOSE_COMMENT_BLOCK2)) Then
ConvertLine = ConvertLine & ls & END_COMMENT
inCommentBlock = False
Else
ConvertLine = ls
End If
Exit Function
End If
For i = 1 To Len(ls)
thisChar = Mid$(ls, i, 1)
If (Instr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", thisChar) > 0) Then
thisWord = thisWord & thisChar
Elseif inQuoteBlock Then
If (thisChar = quoteEndChar) And (Mid$(ls, i, 1) <> quoteEndChar & quoteEndChar) Then
inQuoteBlock = False
quoteEndChar = ""
ConvertLine = ConvertLine & thisWord & thisChar & END_QUOTE
thisWord = ""
Else
thisWord = thisWord & thisChar
End If
Else
If (Instr(wordEndChars, thisChar) > 0) Then
If (Lcase(thisWord) = "rem") Then
ConvertLine = ConvertLine & START_COMMENT & thisWord & Mid$(ls, i) & END_COMMENT
thisWord = ""
Exit For
Elseif Iselement(operators(thisWord)) Then
ConvertLine = ConvertLine & START_OPERATOR & thisWord & END_OPERATOR
Elseif Iselement(keywords(thisWord)) Then
ConvertLine = ConvertLine & START_KEYWORD & thisWord & END_KEYWORD
Elseif Iselement(statements(thisWord)) Then
ConvertLine = ConvertLine & START_STATEMENT & thisWord & END_STATEMENT
Elseif Iselement(functions(thisWord & thisChar)) Then
ConvertLine = ConvertLine & START_FUNCTION & thisWord & thisChar & END_FUNCTION
thisChar = ""
Elseif Iselement(functions(thisWord)) Then
ConvertLine = ConvertLine & START_FUNCTION & thisWord & END_FUNCTION
Elseif Iselement(constants(thisWord)) Then
ConvertLine = ConvertLine & START_CONSTANT & thisWord & END_CONSTANT
Elseif Iselement(classes(thisWord)) Then
ConvertLine = ConvertLine & START_CLASS & thisWord & END_CLASS
Elseif (Mid$(ls, i, 2) = "&#") Then
fooString = Mid$(ls, i, 5)
If (fooString = "&") Then
If (thisWord = "") Then
ConvertLine = ConvertLine & START_OPERATOR & fooString & END_OPERATOR
Else
ConvertLine = ConvertLine & START_DATATYPE & thisWord & fooString & END_DATATYPE
End If
Elseif ((fooString = "<") Or (fooString = ">")) Then
ConvertLine = ConvertLine & thisWord & START_OPERATOR & fooString & END_OPERATOR
Else
ConvertLine = ConvertLine & thisWord & fooString
End If
i = i+4
thisChar = ""
Elseif Iselement(datatypes(thisChar)) And (thisWord <> "") Then
ConvertLine = ConvertLine & START_DATATYPE & thisWord & thisChar & END_DATATYPE
thisChar = ""
Else
ConvertLine = ConvertLine & thisWord
End If
If (thisChar = "%") And (thisWord = "") Then
thisWord = thisChar
Else
If Iselement(operators(thisChar)) Then
ConvertLine = ConvertLine & START_OPERATOR & thisChar & END_OPERATOR
Else
ConvertLine = ConvertLine & thisChar
End If
thisWord = ""
End If
Elseif (Instr("""|{", thisChar) > 0) Then
inQuoteBlock = True
ConvertLine = ConvertLine & thisWord & START_QUOTE & thisChar
thisWord = ""
If (thisChar = "{") Then
quoteEndChar = "}"
Else
quoteEndChar = thisChar
End If
Elseif (thisChar = "'") Then
ConvertLine = ConvertLine & START_COMMENT & Mid$(ls, i) & END_COMMENT
Exit For
Else
thisWord = thisWord & thisChar
End If
End If
Next
If Iselement(operators(thisWord)) Then
ConvertLine = ConvertLine & START_OPERATOR & thisWord & END_OPERATOR
Elseif Iselement(keywords(thisWord)) Then
ConvertLine = ConvertLine & START_KEYWORD & thisWord & END_KEYWORD
Elseif Iselement(statements(thisWord)) Then
ConvertLine = ConvertLine & START_STATEMENT & thisWord & END_STATEMENT
Elseif Iselement(functions(thisWord)) Then
ConvertLine = ConvertLine & START_FUNCTION & thisWord & END_FUNCTION
Elseif Iselement(constants(thisWord)) Then
ConvertLine = ConvertLine & START_CONSTANT & thisWord & END_CONSTANT
Elseif Iselement(classes(thisWord)) Then
ConvertLine = ConvertLine & START_CLASS & thisWord & END_CLASS
Else
ConvertLine = ConvertLine & thisWord
End If
End Function
Sub ResetGlobals ()
inCommentBlock = False
inQuoteBlock = False
quoteEndChar = ""
End Sub
Sub Initialize
Call ResetGlobals
wordEndChars = " .,+-*/\^<>=()%!#@$&:" & Chr(9)
datatypes("%") = ""
datatypes("!") = ""
datatypes("#") = ""
datatypes("@") = ""
datatypes("$") = ""
operators("+") = ""
operators("-") = ""
operators("*") = ""
operators("/") = ""
operators("\") = ""
operators("=") = ""
operators("<") = ""
operators(">") = ""
operators("(") = ""
operators(")") = ""
operators(".") = ""
operators(",") = ""
operators("_") = ""
operators(":") = ""
operators("#") = ""
operators("And") = ""
operators("Eqv") = ""
operators("Imp") = ""
operators("Is") = ""
operators("IsA") = ""
operators("Like") = ""
operators("Mod") = ""
operators("Not") = ""
operators("Or") = ""
operators("Xor") = ""
keywords("Access") = ""
keywords("Alias") = ""
keywords("Append") = ""
keywords("Array") = ""
keywords("As") = ""
keywords("Base") = ""
keywords("Binary") = ""
keywords("Bind") = ""
keywords("ByVal") = ""
keywords("ByRef") = ""
keywords("Compare") = ""
keywords("Currency") = ""
keywords("Declare") = ""
keywords("Event") = ""
keywords("Explicit") = ""
keywords("Currency") = ""
keywords("From") = ""
keywords("GoSub") = ""
keywords("GoTo") = ""
keywords("Initialize") = ""
keywords("Input") = ""
keywords("Integer") = ""
keywords("Len") = ""
keywords("Lib") = ""
keywords("List") = ""
keywords("LMBCS") = ""
keywords("LoadMsgFile") = ""
keywords("Lock") = ""
keywords("Long") = ""
keywords("LSServer") = ""
keywords("Me") = ""
keywords("MsgDescription") = ""
keywords("MsgText") = ""
keywords("New") = ""
keywords("NoCase") = ""
keywords("NoPitch") = ""
keywords("Option") = ""
keywords("Output") = ""
keywords("Pitch") = ""
keywords("Preserve") = ""
keywords("Private") = ""
keywords("Public") = ""
keywords("Published") = ""
keywords("Random") = ""
keywords("Read") = ""
keywords("Remove") = ""
keywords("Shared") = ""
keywords("Single") = ""
keywords("Static") = ""
keywords("String") = ""
keywords("Terminate") = ""
keywords("Unicode") = ""
keywords("Variant") = ""
keywords("Write") = ""
statements("Case") = ""
statements("Class") = ""
statements("Const") = ""
statements("Dim") = ""
statements("Do") = ""
statements("Else") = ""
statements("%Else") = ""
statements("ElseIf") = ""
statements("%ElseIf") = ""
statements("End") = ""
statements("%End") = ""
statements("%ENDREM") = ""
statements("Exit") = ""
statements("For") = ""
statements("ForAll") = ""
statements("Function") = ""
statements("Get") = ""
statements("If") = ""
statements("%If") = ""
statements("Include") = ""
statements("%Include") = ""
statements("Let") = ""
statements("Loop") = ""
statements("Next") = ""
statements("On") = ""
statements("Property") = ""
statements("ReDim") = ""
statements("REM") = ""
statements("%REM") = ""
statements("Resume") = ""
statements("Return") = ""
statements("Select") = ""
statements("Set") = ""
statements("Step") = ""
statements("Stop") = ""
statements("Sub") = ""
statements("Then") = ""
statements("To") = ""
statements("Type") = ""
statements("Use") = ""
statements("UseLSX") = ""
statements("Wend") = ""
statements("While") = ""
statements("With") = ""
functions("Abs") = ""
functions("ACos") = ""
functions("ActivateApp") = ""
functions("ArrayAppend") = ""
functions("ArrayGetIndex") = ""
functions("ArrayReplace") = ""
functions("Asc") = ""
functions("ASin") = ""
functions("ATn") = ""
functions("ATn2") = ""
functions("Beep") = ""
functions("Bin") = ""
functions("Bin$") = ""
functions("Call") = ""
functions("CCur") = ""
functions("CDat") = ""
functions("CDbl") = ""
functions("ChDir") = ""
functions("ChDrive") = ""
functions("Chr") = ""
functions("Chr$") = ""
functions("CInt") = ""
functions("CLng") = ""
functions("Close") = ""
functions("CodeLock") = ""
functions("CodeLockCheck") = ""
functions("CodeUnlock") = ""
functions("Command") = ""
functions("Command$") = ""
functions("Cos") = ""
functions("CreateLock") = ""
functions("CreateObject") = ""
functions("CSng") = ""
functions("CStr") = ""
functions("CurDir") = ""
functions("CurDir$") = ""
functions("CurDrive") = ""
functions("CurDrive$") = ""
functions("CVar") = ""
functions("DataType") = ""
functions("Date") = ""
functions("Date$") = ""
functions("DateNumber") = ""
functions("DateSerial") = ""
functions("DateValue") = ""
functions("Day") = ""
functions("Deftype") = ""
functions("DefCur") = ""
functions("DefDbl") = ""
functions("DefInt") = ""
functions("DefLng") = ""
functions("DefSng") = ""
functions("DefStr") = ""
functions("DefVar") = ""
functions("Delete") = ""
functions("DestroyLock") = ""
functions("Dir") = ""
functions("Dir$") = ""
functions("Doevents") = ""
functions("Environ") = ""
functions("Environ$") = ""
functions("EOF") = ""
functions("Erase") = ""
functions("Erl") = ""
functions("Err") = ""
functions("Error") = ""
functions("Error$") = ""
functions("Evaluate") = ""
functions("Execute") = ""
functions("Exp") = ""
functions("FileAttr") = ""
functions("FileCopy") = ""
functions("FileDateTime") = ""
functions("FileLen") = ""
functions("Fix") = ""
functions("Format") = ""
functions("Format$") = ""
functions("Fraction") = ""
functions("FreeFile") = ""
functions("FullTrim") = ""
functions("GetFileAttr") = ""
functions("GetObject") = ""
functions("GetThreadInfo") = ""
functions("Hex") = ""
functions("Hour") = ""
functions("IMESetMode") = ""
functions("IMEStatus") = ""
functions("Input") = ""
functions("Input$") = ""
functions("InputB") = ""
functions("InputB$") = ""
functions("InputBP") = ""
functions("InputBP$") = ""
functions("InputBox") = ""
functions("InputBox$") = ""
functions("InStr") = ""
functions("InStrB") = ""
functions("InStrBP") = ""
functions("InStrC") = ""
functions("Int") = ""
functions("IsArray") = ""
functions("IsDate") = ""
functions("IsDefined") = ""
functions("IsElement") = ""
functions("IsEmpty") = ""
functions("IsList") = ""
functions("IsNull") = ""
functions("IsNumeric") = ""
functions("IsObject") = ""
functions("IsScalar") = ""
functions("IsUnknown") = ""
functions("Kill") = ""
functions("LBound") = ""
functions("LCase") = ""
functions("LCase$") = ""
functions("Left") = ""
functions("Left$") = ""
functions("LeftB") = ""
functions("LeftB$") = ""
functions("LeftBP") = ""
functions("LeftBP$") = ""
functions("LeftC") = ""
functions("Len") = ""
functions("LenB") = ""
functions("LenBP") = ""
functions("LenC") = ""
functions("Line") = ""
functions("ListTag") = ""
functions("LOC") = ""
functions("Lock") = ""
functions("LOF") = ""
functions("Log") = ""
functions("LSet") = ""
functions("LTrim") = ""
functions("LTrim$") = ""
functions("MessageBox") = ""
functions("Mid") = ""
functions("Mid$") = ""
functions("MidB") = ""
functions("MidB$") = ""
functions("MidBP") = ""
functions("MidBP$") = ""
functions("MidC") = ""
functions("Minute") = ""
functions("MkDir") = ""
functions("Month") = ""
functions("MsgBox") = ""
functions("Name") = ""
functions("Now") = ""
functions("Oct") = ""
functions("Oct$") = ""
functions("Open") = ""
functions("Print") = ""
functions("Put") = ""
functions("Randomize") = ""
functions("Reset") = ""
functions("Right") = ""
functions("Right$") = ""
functions("RightB") = ""
functions("RightB$") = ""
functions("RightBP") = ""
functions("RightBP$") = ""
functions("RightC") = ""
functions("RmDir") = ""
functions("Rnd") = ""
functions("Round") = ""
functions("RSet") = ""
functions("RTrim") = ""
functions("RTrim$") = ""
functions("Run") = ""
functions("Second") = ""
functions("Seek") = ""
functions("SendKeys") = ""
functions("SetFileAttr") = ""
functions("Sgn") = ""
functions("Shell") = ""
functions("Sin") = ""
functions("Sleep") = ""
functions("Space") = ""
functions("Space$") = ""
functions("Spc") = ""
functions("Sqr") = ""
functions("Str") = ""
functions("Str$") = ""
functions("StrComp") = ""
functions("StrCompare") = ""
functions("StrConv") = ""
functions("StrLeft") = ""
functions("StrLeftBack") = ""
functions("StrRight") = ""
functions("StrRightBack") = ""
functions("String") = ""
functions("String$") = ""
functions("Tab") = ""
functions("Tan") = ""
functions("Time") = ""
functions("Time$") = ""
functions("TimeNumber") = ""
functions("TimeSerial") = ""
functions("TimeValue") = ""
functions("Timer") = ""
functions("Today") = ""
functions("Trim") = ""
functions("Trim$") = ""
functions("TypeName") = ""
functions("UBound") = ""
functions("UCase") = ""
functions("UCase$") = ""
functions("UChr") = ""
functions("UChr$") = ""
functions("Uni") = ""
functions("Unlock") = ""
functions("UString") = ""
functions("UString$") = ""
functions("Val") = ""
functions("Weekday") = ""
functions("Width") = ""
functions("Write") = ""
functions("Year") = ""
functions("Yield") = ""
constants("Empty") = ""
constants("False") = ""
constants("Nothing") = ""
constants("Null") = ""
constants("Pi") = ""
constants("True") = ""
constants("WIN16") = ""
constants("WIN32") = ""
constants("WINNT") = ""
constants("WIN95") = ""
constants("WIN40") = ""
constants("WINDOWS") = ""
constants("HPUX") = ""
constants("SOLARIS") = ""
constants("UNIX") = ""
constants("OS2") = ""
constants("MAC") = ""
constants("OLE") = ""
constants("MAC68K") = ""
constants("MACPPC") = ""
constants("ACLLEVEL_AUTHOR") = ""
constants("ACLLEVEL_DEPOSITOR") = ""
constants("ACLLEVEL_DESIGNER") = ""
constants("ACLLEVEL_EDITOR") = ""
constants("ACLLEVEL_MANAGER") = ""
constants("ACLLEVEL_NOACCESS") = ""
constants("ACLLEVEL_READER") = ""
constants("ACLTYPE_MIXED_GROUP") = ""
constants("ACLTYPE_PERSON") = ""
constants("ACLTYPE_PERSON_GROUP") = ""
constants("ACLTYPE_SERVER") = ""
constants("ACLTYPE_SERVER_GROUP") = ""
constants("ACLTYPE_UNSPECIFIED") = ""
constants("ACTIONCD") = ""
constants("ALIGN_CENTER") = ""
constants("ALIGN_FULL") = ""
constants("ALIGN_LEFT") = ""
constants("ALIGN_NOWRAP") = ""
constants("ALIGN_RIGHT") = ""
constants("ASSISTANTINFO") = ""
constants("ATTACHMENT") = ""
constants("AUTHORS") = ""
constants("COLOR_BLACK") = ""
constants("COLOR_BLUE") = ""
constants("COLOR_CYAN") = ""
constants("COLOR_DARK_BLUE") = ""
constants("COLOR_DARK_CYAN") = ""
constants("COLOR_DARK_GREEN") = ""
constants("COLOR_DARK_MAGENTA") = ""
constants("COLOR_DARK_RED") = ""
constants("COLOR_DARK_YELLOW") = ""
constants("COLOR_GRAY") = ""
constants("COLOR_GREEN") = ""
constants("COLOR_LIGHT_GRAY") = ""
constants("COLOR_MAGENTA") = ""
constants("COLOR_RED") = ""
constants("COLOR_WHITE") = ""
constants("COLOR_YELLOW") = ""
constants("DATABASE") = ""
constants("DATETIMES") = ""
constants("DB_REPLICATION_PRIORITY_HIGH") = ""
constants("DB_REPLICATION_PRIORITY_LOW") = ""
constants("DB_REPLICATION_PRIORITY_MED") = ""
constants("DB_REPLICATION_PRIORITY_NOTSET") = ""
constants("EFFECTS_EMBOSS") = ""
constants("EFFECTS_EXTRUDE") = ""
constants("EFFECTS_NONE") = ""
constants("EFFECTS_SHADOW") = ""
constants("EFFECTS_SUBSCRIPT") = ""
constants("EFFECTS_SUPERSCRIPT") = ""
constants("EMBED_ATTACHMENT") = ""
constants("EMBED_OBJECT") = ""
constants("EMBED_OBJECTLINK") = ""
constants("EMBEDDEDOBJECT") = ""
constants("ERRORITEM") = ""
constants("EV_ALARM") = ""
constants("EV_COMM") = ""
constants("EV_MAIL") = ""
constants("EV_MISC") = ""
constants("EV_REPLICA") = ""
constants("EV_RESOURCE") = ""
constants("EV_SECURITY") = ""
constants("EV_SERVER") = ""
constants("EV_UNKNOWN") = ""
constants("EV_UPDATE") = ""
constants("FONT_COURIER") = ""
constants("FONT_HELV") = ""
constants("FONT_ROMAN") = ""
constants("FORMULA") = ""
constants("FT_DATABASE") = ""
constants("FT_DATE_ASC") = ""
constants("FT_DATE_DES") = ""
constants("FT_FILESYSTEM") = ""
constants("FT_FUZZY") = ""
constants("FT_SCORES") = ""
constants("FT_STEMS") = ""
constants("FT_THESAURUS") = ""
constants("HTML") = ""
constants("ICON") = ""
constants("ID_CERTIFIER") = ""
constants("ID_FLAT") = ""
constants("ID_HIERARCHICAL") = ""
constants("LSOBJECT") = ""
constants("MIME_PART") = ""
constants("NAMES") = ""
constants("NOTESLINKS") = ""
constants("NOTEREFS") = ""
constants("NOTES_DESKTOP_CLIENT") = ""
constants("NOTES_FULL_CLIENT") = ""
constants("NOTES_LIMITED_CLIENT") = ""
constants("NUMBERS") = ""
constants("OTHEROBJECT") = ""
constants("OUTLINE_CLASS_DATABASE") = ""
constants("OUTLINE_CLASS_DOCUMENT") = ""
constants("OUTLINE_CLASS_FOLDER") = ""
constants("OUTLINE_CLASS_FORM") = ""
constants("OUTLINE_CLASS_FRAMESET") = ""
constants("OUTLINE_CLASS_NAVIGATOR") = ""
constants("OUTLINE_CLASS_PAGE") = ""
constants("OUTLINE_CLASS_UNKNOWN") = ""
constants("OUTLINE_CLASS_VIEW") = ""
constants("OUTLINE_OTHER_FOLDERS_TYPE") = ""
constants("OUTLINE_OTHER_UNKNOWN_TYPE") = ""
constants("OUTLINE_OTHER_VIEWS_TYPE") = ""
constants("OUTLINE_TYPE_ACTION") = ""
constants("OUTLINE_TYPE_NAMEDELEMENT") = ""
constants("OUTLINE_TYPE_NOTELINK") = ""
constants("OUTLINE_TYPE_URL") = ""
constants("PAGINATE_BEFORE") = ""
constants("PAGINATE_DEFAULT") = ""
constants("PAGINATE_KEEP_TOGETHER") = ""
constants("PAGINATE_KEEP_WITH_NEXT") = ""
constants("PICKLIST_CUSTOM") = ""
constants("PICKLIST_NAMES") = ""
constants("PICKLIST_RESOURCES") = ""
constants("PICKLIST_ROOMS") = ""
constants("PROMPT_OK") = ""
constants("PROMPT_OKCANCELCOMBO") = ""
constants("PROMPT_OKCANCELEDIT") = ""
constants("PROMPT_OKCANCELEDITCOMBO") = ""
constants("PROMPT_OKCANCELLIST") = ""
constants("PROMPT_OKCANCELLISTMULT") = ""
constants("PROMPT_PASSWORD") = ""
constants("PROMPT_YESNO") = ""
constants("PROMPT_YESNOCANCEL") = ""
constants("QUERYCD") = ""
constants("READERS") = ""
constants("REPLICA_CANDIDATE") = ""
constants("RICHTEXT") = ""
constants("RULER_ONE_CENTIMETER") = ""
constants("RULER_ONE_INCH") = ""
constants("SEV_FAILURE") = ""
constants("SEV_FATAL") = ""
constants("SEV_NORMAL") = ""
constants("SEV_WARNING1") = ""
constants("SEV_WARNING2") = ""
constants("SIGNATURE") = ""
constants("SPACING_DOUBLE") = ""
constants("SPACING_ONE_POINT_50") = ""
constants("SPACING_SINGLE") = ""
constants("STYLE_NO_CHANGE") = ""
constants("TAB_CENTER") = ""
constants("TAB_DECIMAL") = ""
constants("TAB_LEFT") = ""
constants("TAB_RIGHT") = ""
constants("TARGET_ALL_DOCS") = ""
constants("TARGET_ALL_DOCS_IN_VIEW") = ""
constants("TARGET_NEW_DOCS") = ""
constants("TARGET_NEW_OR_MODIFIED_DOCS") = ""
constants("TARGET_NONE") = ""
constants("TARGET_RUN_ONCE") = ""
constants("TARGET_SELECTED_DOCS") = ""
constants("TARGET_UNREAD_DOCS_IN_VIEW") = ""
constants("TEMPLATE") = ""
constants("TEMPLATE_CANDIDATE") = ""
constants("TEXT") = ""
constants("TRIGGER_AFTER_MAIL_DELIVERY") = ""
constants("TRIGGER_BEFORE_MAIL_DELIVERY") = ""
constants("TRIGGER_DOC_PASTED") = ""
constants("TRIGGER_DOC_UPDATE") = ""
constants("TRIGGER_MANUAL") = ""
constants("TRIGGER_NONE") = ""
constants("TRIGGER_SCHEDULED") = ""
constants("UNAVAILABLE") = ""
constants("UNKNOWN") = ""
constants("USERDATA") = ""
constants("USERID") = ""
constants("VC_ALIGN_CENTER") = ""
constants("VC_ALIGN_LEFT") = ""
constants("VC_ALIGN_RIGHT") = ""
constants("VC_ATTR_PARENS") = ""
constants("VC_ATTR_PUNCTUATED") = ""
constants("VC_ATTR_PERCENT") = ""
constants("VC_FMT_ALWAYS") = ""
constants("VC_FMT_CURRENCY") = ""
constants("VC_FMT_DATE") = ""
constants("VC_FMT_DATETIME") = ""
constants("VC_FMT_FIXED") = ""
constants("VC_FMT_GENERAL") = ""
constants("VC_FMT_HM") = ""
constants("VC_FMT_HMS") = ""
constants("VC_FMT_MD") = ""
constants("VC_FMT_NEVER") = ""
constants("VC_FMT_SCIENTIFIC") = ""
constants("VC_FMT_SOMETIMES") = ""
constants("VC_FMT_TIME") = ""
constants("VC_FMT_TODAYTIME") = ""
constants("VC_FMT_YM") = ""
constants("VC_FMT_YMD") = ""
constants("VC_FMT_Y4M") = ""
constants("VC_FONT_BOLD") = ""
constants("VC_FONT_ITALIC") = ""
constants("VC_FONT_STRIKEOUT") = ""
constants("VC_FONT_UNDERLINE") = ""
constants("VC_SEP_COMMA") = ""
constants("VC_SEP_NEWLINE") = ""
constants("VC_SEP_SEMICOLON") = ""
constants("VC_SEP_SPACE") = ""
constants("VIEWMAPDATA") = ""
constants("VIEWMAPLAYOUT") = ""
constants("VW_SPACING_DOUBLE") = ""
constants("VW_SPACING_ONE_POINT_25") = ""
constants("VW_SPACING_ONE_POINT_50") = ""
constants("VW_SPACING_ONE_POINT_75") = ""
constants("VW_SPACING_SINGLE") = ""
classes("Button") = ""
classes("Field") = ""
classes("Navigator") = ""
classes("NotesACL") = ""
classes("NotesACLEntry") = ""
classes("NotesAgent") = ""
classes("NotesDatabase") = ""
classes("NotesDateRange") = ""
classes("NotesDateTime") = ""
classes("NotesDbDirectory") = ""
classes("NotesDocument") = ""
classes("NotesDocumentCollection") = ""
classes("NotesEmbeddedObject") = ""
classes("NotesForm") = ""
classes("NotesInternational") = ""
classes("NotesItem") = ""
classes("NotesLog") = ""
classes("NotesMIMEEntity") = ""
classes("NotesName") = ""
classes("NotesNewsletter") = ""
classes("NotesOutline") = ""
classes("NotesOutlineEntry") = ""
classes("NotesRegistration") = ""
classes("NotesReplication") = ""
classes("NotesRichTextItem") = ""
classes("NotesRichTextParagraphStyle") = ""
classes("NotesRichTextStyle") = ""
classes("NotesRichTextTab") = ""
classes("NotesSession") = ""
classes("NotesTimer") = ""
classes("NotesUIDatabase") = ""
classes("NotesUIDocument") = ""
classes("NotesUIView") = ""
classes("NotesUIWorkspace") = ""
classes("NotesView") = ""
classes("NotesViewColumn") = ""
classes("NotesViewEntry") = ""
classes("NotesViewEntryCollection") = ""
classes("NotesViewNavigator") = ""
classes("ODBCConnection") = ""
classes("ODBCQuery") = ""
classes("ODBCResultSet") = ""
keywords("Boolean") = ""
keywords("Byte") = ""
keywords("Charset") = ""
functions("CBool") = ""
functions("CByte") = ""
functions("Implode") = ""
functions("Join") = ""
functions("Replace") = ""
functions("Split") = ""
functions("StrToken") = ""
classes("JavaClass") = ""
classes("JavaError") = ""
classes("JavaMethod") = ""
classes("JavaMethodCollection") = ""
classes("JavaObject") = ""
classes("JavaProperty") = ""
classes("JavaPropertyCollection") = ""
classes("JavaSession") = ""
classes("NotesAdministrationProcesss") = ""
classes("NotesColorObject") = ""
classes("NotesDOMAttributeNode") = ""
classes("NotesDOMCDATASectionNode") = ""
classes("NotesDOMCharacterDataNode") = ""
classes("NotesDOMCommentNode") = ""
classes("NotesDOMDocumentFragmentNode") = ""
classes("NotesDOMDocumentNode") = ""
classes("NotesDOMDocumentTypeNode") = ""
classes("NotesDOMElementNode") = ""
classes("NotesDOMEntityNode") = ""
classes("NotesDOMEntityReferenceNode") = ""
classes("NotesDOMNamedNodeMap") = ""
classes("NotesDOMNode") = ""
classes("NotesDOMNodeList") = ""
classes("NotesDOMNotationNode") = ""
classes("NotesDOMParser") = ""
classes("NotesDOMProcessingInstructionNode") = ""
classes("NotesDOMTextNode") = ""
classes("NotesDOMXMLDeclNode") = ""
classes("NotesDXLExporter") = ""
classes("NotesDXLImporter") = ""
classes("NotesMIMEHeader") = ""
classes("NotesNoteCollection") = ""
classes("NotesReplicationEntry") = ""
classes("NotesRichTextDocLink") = ""
classes("NotesRichTextNavigator") = ""
classes("NotesRichTextRange") = ""
classes("NotesRichTextSelection") = ""
classes("NotesRichTextTable") = ""
classes("NotesSAXAttributeList") = ""
classes("NotesSAXException") = ""
classes("NotesSAXParser") = ""
classes("NotesStream") = ""
classes("NotesUIScheduler") = ""
classes("NotesXMLProcessor") = ""
classes("NotesXSLTransformer") = ""
End Sub
Sub ConvertInvalidHTML (ls As String)
ls = ReplaceSubstring(ls, "&", "&")
ls = ReplaceSubstring(ls, "<", "<")
ls = ReplaceSubstring(ls, ">", ">")
End Sub
Function ReplaceSubstring (Byval theString As String, find As String, replace As String) As String
Dim pos As Integer
pos = Instr(theString, find)
Do While (pos > 0)
theString = Left$(theString, pos - 1) & replace & Mid$(theString, pos + Len(find))
pos = Instr(pos + Len(replace), theString, find)
Loop
ReplaceSubstring = theString
End Function
Function GetLineTerminator (theString As String) As String
If (Instr(theString, Chr(13) & Chr(10)) > 0) Then
GetLineTerminator = Chr(13) & Chr(10)
Elseif (Instr(theString, Chr(13)) > 0) Then
GetLineTerminator = Chr(13)
Elseif (Instr(theString, Chr(10)) > 0) Then
GetLineTerminator = Chr(10)
Elseif (Instr(theString, Chr(0)) > 0) Then
GetLineTerminator = Chr(0)
Else
GetLineTerminator = Chr(10)
End If
End Function
Function StyleDefToString (style As StyleDef) As String
Dim lineTerm As String
Dim styleString As String
lineTerm = Chr(13) & Chr(10)
styleString = "." & SCRIPT_STYLE & " { " & style.script & " }" & lineterm
styleString = styleString & "." & COMMENT_STYLE & " { " & style.comment & " }" & lineTerm
styleString = styleString & "." & QUOTE_STYLE & " { " & style.quote & " }" & lineTerm
styleString = styleString & "." & DATATYPE_STYLE & " { " & style.datatype & " }" & lineTerm
styleString = styleString & "." & OPERATOR_STYLE & " { " & style.operator & " }" & lineTerm
styleString = styleString & "." & KEYWORD_STYLE & " { " & style.keyword & " }" & lineTerm
styleString = styleString & "." & STATEMENT_STYLE & " { " & style.statement & " }" & lineTerm
styleString = styleString & "." & FUNCTION_STYLE & " { " & style.function & " }" & lineTerm
styleString = styleString & "." & CLASS_STYLE & " { " & style.class & " }" & lineTerm
styleString = styleString & "." & CONSTANT_STYLE & " { " & style.constant & " }" & lineTerm
StyleDefToString = styleString
End Function
Sub GetDefaultLsStyleDef (style As StyleDef)
style.script = "font-family: sans-serif; font-size: 9pt; color: black;"
style.comment = "color: green;"
style.quote = "color: black;"
style.datatype = "color: black;"
style.operator = "color: blue;"
style.keyword = "color: blue;"
style.statement = "color: blue;"
style.function = "color: blue;"
style.class = "color: black;"
style.constant = "color: purple;"
End Sub
Sub ResetStyleInfo (style As StyleDef, useCSS As Integer)
If (useCSS = OUTPUT_INLINE_STYLE) Then
START_SCRIPT = "<pre><div style=""" & style.script & """>"
END_SCRIPT = "</div></pre>"
START_COMMENT = "<font style=""" & style.comment & """>"
END_COMMENT = "</font>"
START_QUOTE = "<font style=""" & style.quote & """>"
END_QUOTE = "</font>"
START_DATATYPE = "<font style=""" & style.datatype & """>"
END_DATATYPE = "</font>"
START_OPERATOR = "<font style=""" & style.operator & """>"
END_OPERATOR = "</font>"
START_KEYWORD = "<font style=""" & style.keyword & """>"
END_KEYWORD = "</font>"
START_STATEMENT = "<font style=""" & style.statement & """>"
END_STATEMENT = "</font>"
START_FUNCTION = "<font style=""" & style.function & """>"
END_FUNCTION = "</font>"
START_CLASS = "<font style=""" & style.class & """>"
END_CLASS = "</font>"
START_CONSTANT = "<font style=""" & style.constant & """>"
END_CONSTANT = "</font>"
Elseif (useCSS = OUTPUT_TAGS) Then
START_SCRIPT = "<" & SCRIPT_STYLE & ">"
END_SCRIPT = "</" & SCRIPT_STYLE & ">"
START_COMMENT = "<" & COMMENT_STYLE & ">"
END_COMMENT = "</" & COMMENT_STYLE & ">"
START_QUOTE = "<" & QUOTE_STYLE & ">"
END_QUOTE = "</" & QUOTE_STYLE & ">"
START_DATATYPE = "<" & DATATYPE_STYLE & ">"
END_DATATYPE = "</" & DATATYPE_STYLE & ">"
START_OPERATOR = "<" & OPERATOR_STYLE & ">"
END_OPERATOR = "</" & OPERATOR_STYLE & ">"
START_KEYWORD = "<" & KEYWORD_STYLE & ">"
END_KEYWORD = "</" & KEYWORD_STYLE & ">"
START_STATEMENT = "<" & STATEMENT_STYLE & ">"
END_STATEMENT = "</" & STATEMENT_STYLE & ">"
START_FUNCTION = "<" & FUNCTION_STYLE & ">"
END_FUNCTION = "</" & FUNCTION_STYLE & ">"
START_CLASS = "<" & CLASS_STYLE & ">"
END_CLASS = "</" & CLASS_STYLE & ">"
START_CONSTANT = "<" & CONSTANT_STYLE & ">"
END_CONSTANT = "</" & CONSTANT_STYLE & ">"
Else
START_SCRIPT = "<pre><div class=" & SCRIPT_STYLE & ">"
END_SCRIPT = "</div></pre>"
START_COMMENT = "<font class=" & COMMENT_STYLE & ">"
END_COMMENT = "</font>"
START_QUOTE = "<font class=" & QUOTE_STYLE & ">"
END_QUOTE = "</font>"
START_DATATYPE = "<font class=" & DATATYPE_STYLE & ">"
END_DATATYPE = "</font>"
START_OPERATOR = "<font class=" & OPERATOR_STYLE & ">"
END_OPERATOR = "</font>"
START_KEYWORD = "<font class=" & KEYWORD_STYLE & ">"
END_KEYWORD = "</font>"
START_STATEMENT = "<font class=" & STATEMENT_STYLE & ">"
END_STATEMENT = "</font>"
START_FUNCTION = "<font class=" & FUNCTION_STYLE & ">"
END_FUNCTION = "</font>"
START_CLASS = "<font class=" & CLASS_STYLE & ">"
END_CLASS = "</font>"
START_CONSTANT = "<font class=" & CONSTANT_STYLE & ">"
END_CONSTANT = "</font>"
End If
End Sub
Function SuperTrim (thisString As String) As String
Dim newString As String
Dim char As String
Dim i As Integer
Dim whitespace As String
Dim lastCharWasSpace As Integer
whitespace = " " & Chr(9) & Chr(0) & Chr(10) & Chr(13)
lastCharWasSpace = False
For i = 1 To Len(thisString)
char = Mid$(thisString, i, 1)
If (Instr(whitespace, char) > 0) Then
If Not (lastCharWasSpace) Then
newString = newString & " "
End If
lastCharWasSpace = True
Else
newString = newString & char
lastCharWasSpace = False
End If
Next
SuperTrim = Trim$(newString)
End Function