Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a space chr - dBase III Plus

Status
Not open for further replies.

Rosciano

Technical User
Jun 16, 2003
64
IT
Hi everybody,

I need help with this situation: I need to find two spaces on a Character field named “descrip”. The length of the field is 40 characters.

Example of field descrip: Holographic Filament Indigo Blue

I would need a single code to find the two last “spaces”, the first between “Filament” and “Indigo” and the second space between “Indigo” and “Blue”
Of course, the field can be any length up to 40 characters and can have more than two spaces.

Thank for your help, I had been working two days with that code without any practical solution.
[smile]

Antonio
Italy
dBase III Plus
 
Hi everybody [peace]

Never mind, I have already did it!

Thanks [wink]
 
And your solution was...?

I took a look at this (from within Visual FoxPro which had its roots as a dBase alternative) and decided to the the RAT() function, similar to AT() but it searches the expression in reverse order. The sample below removes the trailing blanks first with the RTRIM() or TRIM() functions.

Code:
? RAT(" ",TRIM("Holographic Filament Indigo Blue   "),2)  && string location of next to last space
? RAT(" ",TRIM("Holographic Filament Indigo Blue   "),1)  && string location of last space
 
Thank you for your answer dbMark,

I’m using dBase III Plus Ver. 1.1 May be it is too old compared to yours.
Sorry, there were THREE spaces in my example, instead of TWO.

I did it already, in a different way, thanks anyway.
BTW, I compile with Clipper to work with an .EXE file and it doesn’t accept many dBase commands, RTRIM() is one of them.
 
In Visual FoxPro, TRIM() and RTRIM() are identical. I didn't intend to confuse the issue. Just use what works for you, TRIM().

I believe RTRIM() was added in VFP to have a complete matching set: LTRIM - ALLTRIM - RTRIM (left and right)

I understand you may need to keep using dBase III+ but I'd like to share my experiences with dBase 5.0 for DOS (released 1995). It was a DOS/Windows hybrid interface that worked in Windows up to XP. It was a rather solid app but there were occasional unpredictable quirks. One was SCAN/ENDSCAN that we were unable to prove why it halted partway through on rare scenarios. When our workstations were upgraded from Windows XP to Windows 7 in early 2014 when support ended for XP, it stopped working for us. That forced us to convert to other languages we had been already using elsewhere.
 
Thank you dbMark,
We are about to change (are years that we are saying it...).
We already bought the software dbDOS.EXE from the dBase house ( but we haven't installed it waiting to change equipment, Operating System, etc. Should work without any change to the programs... I hope so!

Where can I find a copy of dBase 5 to give a look at it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top