|
Post by kokenge on Apr 6, 2008 10:44:38 GMT -5
Just 2 quick question. Using Run Basic rbp101b1 Do we need to stay with back slashes. (\)
And I thought the "files" command let you test for files. When I use froward slashes (/) I get the following error Runtime Error in program 'test': files #f, file$ Specified directory does not exist:
file$ = "C:\rbp101b1\*.*" files #f, file$ print "test ok for:";file$
file$ = "C:/rbp101b1/*.*" files #f, file$ print "test ok for:";file$
The first 'files' command works, the second errors.
|
|
|
Post by BillSturm on Apr 6, 2008 21:51:25 GMT -5
Why would you want forward slashes to work? Is that a web thing? I know it is a UNIX thing, but in Dos/Windows it has always been backslashes. Maybe it would be nice if both worked, especially when the Linux version of RB becomes available.
From the RB Manual:
#handle HASANSWER() - Return non-zero if the file accessor has at least one resulting row
I believe that this is how you check if a file exists.
Here is an example, also from the RB Manual:
files #f, "C:\rbp\*.*" while #f hasanswer()
|
|
|
Post by kokenge on Apr 7, 2008 6:15:53 GMT -5
Exactly what I thought. My program does the hasanswer() test, but I get the error before the hasnaswer() test.
Seem to me I should be able to put anything in the files to test no matter what the slash type and it shouldn't give an error. It should wait until I do the hasanswer() test.
Haven't used windows much but as far as I know Windows is the only one who uses back slash. Every language I've used lets you use froward slash, even on windows. Just a lot easier to stay with the forward slash to be more consistent.
|
|