> PLUGINS LoadFileName.RBL 'vFileName +
> |FULLPATH OFF +
> |TITLE Select Document +
> |VIEW_MODE LIST +
> |FILTER MS Word Document Files (*.doc)#*.DOC'
> SET VAR vDirName TEXT = (CVAL('CURRDIR'))
> 
> Both variables (vFileName and vDirName) will return the document
> name and directory name accordingly.

I believe this approach will not work correctly if the user changes the
directory in the dialog before selecting a file.

Try something along these lines (after obtaining the file name):

-- Remove path from filename
SET VAR vFileName = (SRPL(.vFileName, (CVAL('CURRDIR')), '', 0))
-- Remove remaining path delimiter from filename
IF vFileName LIKE '\%' THEN
  SET VAR vFileName = (SGET(.vFileName, (SLEN(.vFileName)), 2))
ENDIF
-- Get current directory including trailing path delimiter.
-- (or leave out the delimiter if you don't want it).
SET VAR vCurDir   = (CVAL('CURRDIR')) + '\'

--
Larry

Reply via email to