A couple small problems
Posted: Sun Sep 07, 2008 10:58 pm
I've discovered a couple small problems w/ the file_open built-in macro function. It appears that in spite of returning a bool (which I assume indicates success) that the function just fails quietly when it thinks the specified file does not exist, but reports success. I say "it thinks", because the second issue is that it does not appear to find files with .. in the path.
I was using the LUA code
local FileB = macro_tag("$FB")
local PSFName = macro_tag("$FDD").."..\\"..FileB..".psf"
local fop = file_open(PSFName)
if not fop then
message("Can't find PSF file "..PSFName)
beep()
return
end
to open a file related to the file I was editing, but got no error message but also no file opened. When I changed the line to:
local PSFName = string.sub(macro_tag("$FDD"),1,- 8 )..FileB..".psf"
it worked fine. The second version strips "Source\" off the end of $FDD so there is no need for the parent directory reference.
This was on 3.96q beta 8 - I haven't had a chance to verify it on my install of 3.96q at work.
Not exactly show stoppers...
Bill
I was using the LUA code
local FileB = macro_tag("$FB")
local PSFName = macro_tag("$FDD").."..\\"..FileB..".psf"
local fop = file_open(PSFName)
if not fop then
message("Can't find PSF file "..PSFName)
beep()
return
end
to open a file related to the file I was editing, but got no error message but also no file opened. When I changed the line to:
local PSFName = string.sub(macro_tag("$FDD"),1,- 8 )..FileB..".psf"
it worked fine. The second version strips "Source\" off the end of $FDD so there is no need for the parent directory reference.
This was on 3.96q beta 8 - I haven't had a chance to verify it on my install of 3.96q at work.
Not exactly show stoppers...

Bill