TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: RONALD SCHLEGEL
from: MICHAEL QUINLAN
date: 1996-05-26 01:57:00
subject: DAT files

Ronald Schlegel wrote in a message to All:
 RS> I am trying to extract a pathname from a *.DAT file. This pathname
 RS> is just called out as a directory (ie C:\BBS), but in the dat file,
 RS> it is declared as a "STRING * 81". How can I "strip" the spaces
 RS> from the right? I have tried RTRIM$ (among others) with no luck at
 RS> all. What I need to be able to do is to use the directory name &
 RS> "tack on" a filename.
After looking at all the answers to your quetions here, I still don't think 
anyone gave you the answer you are looking for.  What I've found is that 
string variables declared with a specific size cannot be "trimmed" - they 
will always be the length declared, padded with the default pad character.
Say you have some code like this:
   DIM var$ as STRING * 10
   var$ = "12345"
var$ is now equal to "12345     ".  If you do this:
   var$ = rtrim$(var$)
var$ is still equal to "12345     ".  But if you do this:
   x$ = rtrim$(var$)
x$ is equal to "12345".
Michael
--- timEd 1.10
---------------
* Origin: The University BBS; Shrewsbury Twp NJ; V34+ (1:107/411)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.