On 19 May 96, Ronald Schlegel wrote to All:
RS> Hello....
RS> I have a question that I've been "fighting" for quite some time.
RS> I am trying to extract a pathname from a *.DAT file. This pathname is
RS> just called out as a directory (ie C:\BBS), but in the dat file, it is
RS> declared as a "STRING * 81". How can I "strip" the spaces from the
RS> right? I have tried RTRIM$ (among others) with no luck at all. What I
RS> need to be able to do is to use the directory name & "tack on" a
RS> filename.
The data is probably null terminated, Ron. What you might need to do is
read the pathname and then use left$ to extract it once you reach the null
terminator and then rtrim$ the result to remove any blanks:
DIM PATHNAME AS STRING * 81
pathname = left$(pathname,instr(pathname, CHR$(0)) - 1)
pathname = rtrim$(pathname)
--- PPoint 2.00
---------------
* Origin: Toast House Remote (1:100/560.1)
|