AddBackslash
str AddBackslash (str)
;..........................................................................................................................................
; strAddBackslash = StrCat (strFolder, StrSub ("\", StrSub (strFolder, StrLen (strFolder), 1) != "\", 1))
;..........................................................................................................................................
; This one line function "AddBackslash" returns a string with trailing backslash.
; A Backslash is added at end of a string if there is no backslash.
;..........................................................................................................................................


;Test.

:Test1
strFolder = "test"
If (StrSub (strFolder, StrLen (strFolder), 1) != "\") Then strFolder = StrCat (strFolder, "\")
Message ("Test 1.1", strFolder)

strFolder = "test\"
If (StrSub (strFolder, StrLen (strFolder), 1) != "\") Then strFolder = StrCat (strFolder, "\")
Message ("Test 1.2", strFolder)

:Test2
strFolder = "test"
strFolder = StrCat (strFolder, StrSub ("\", StrSub (strFolder, StrLen (strFolder), 1) != "\", 1))
Message ("Test 2.1", strFolder)

strFolder = "test\"
strFolder = StrCat (strFolder, StrSub ("\", StrSub (strFolder, StrLen (strFolder), 1) != "\", 1))
Message ("Test 2.2", strFolder)

:Test3
strFolder = "test"
strFolder = strFolder : StrSub ("\", StrSub (strFolder, StrLen (strFolder), 1) != "\", 1)
Message ("Test 3.1", strFolder)

strFolder = "test\"
strFolder = strFolder : StrSub ("\", StrSub (strFolder, StrLen (strFolder), 1) != "\", 1)
Message ("Test 3.2", strFolder)

Exit