01-10-2023, 06:43 PM
I was thinking more along the lines of something simple such as:
Code: (Select All)
foo$ = "./mydir/foo.txt"
Print foo$
Print setSlash$(foo$)
foo2$ = ".\mydir\foo.txt"
Print foo2$
Print setSlash$(foo2$)
foo3$ = "./mydir\foo.txt"
Print foo3$
Print setSlash$(foo3$)
Function setSlash$ (text$)
temp$ = text$
$If WIN Then
desiredSlash$ = "\"
badSlash$ = "/"
$Else
desiredSlash$ ="/"
badSlash$ = "\"
$End If
Do
p = InStr(temp$, badSlash$)
If p Then Mid$(temp$, p, 1) = desiredSlash$
Loop Until p <= 0
setSlash$ = temp$
End Function