Jim: Thanks you for this gem. It worked perfectly. I am using it today.
Thanks again, Jim At 08:47 AM 9/2/05 -0400, you wrote: >Better still try the following: >SET VAR vxxx = (SRPL(.vFileName, '/', ',', 0)) >set var vfile = (ssub(.vxxx,(itemcnt(.vFileName)))) >set var vpath = (sget(.vFileName,((SLEN(.vFileName)) - (SLEN(.vfile))),1)) >-- >Jim Bentley >American Celiac Society >email: [EMAIL PROTECTED] > > > > > >-----Original Message----- >From: Lawrence Lustig <[EMAIL PROTECTED]> >Sent: Fri, 2 Sep 2005 04:59:06 -0700 (PDT) >To: [email protected] (RBASE-L Mailing List) >Subject: [RBASE-L] - Re: Parsing a returned value > >> 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 > ======================================== Jim Schmitt Ohio Software Services 2211 Lake Club Drive Columbus, Oh 43232 Phone 1-614-863-1850 Fax 1-614-863-0325 E-mail [EMAIL PROTECTED] ========================================

