Hey,
I'm trying to use Deletefile function. It works fine if I use something like this: "Deletefile("d:\\test\\text.txt")".
My program gets full path as an agrument to the program. Ex: "d:\test\text.txt".
As I understand the Deletefile must have the "\\" notation.
My problem is now to convert the path from "d:\test\text.txt" to "d:\\test\\text.txt"
So far this is my best shot:
SUB convert_path(path:STRING),STRING
STRING out
out = ""
FOR x= 1 to len(path)
out += MID$(path,x,1)
IF MID$(path,x,1) = CHR$(92)
out += CHR$(92)
ENDIF
NEXT x
RETURN out
ENDSUB
This is not working since it interpret "\t" as tab and "\n" as new line etc.
Is there any trick to avoid this? Or any other function I can use?
Suggestions appreciated.
Regards,
Kim
If your variable of path has: d:\test\text.txt in it then it should work ok. You see "\\", but this stores \ not \\. "\\" is EBasics way of storing a \.
You can use Deletefile(path) and it should work fine, unless you do not have sufficient access to delete the file.
Bill
Review the users guide on string literals. It is only when you are typing a string in the source code that you need to escape certain characters.
Thanks! I see it now. My bad :)