×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Finding a space chr - dBase III Plus

Finding a space chr - dBase III Plus

Finding a space chr - dBase III Plus

(OP)
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

RE: Finding a space chr - dBase III Plus

(OP)
Hi everybody peace

Never mind, I have already did it!

Thanks wink

RE: Finding a space chr - dBase III Plus

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 

RE: Finding a space chr - dBase III Plus

(OP)
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.

RE: Finding a space chr - dBase III Plus

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.

RE: Finding a space chr - dBase III Plus

(OP)
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 (http://www.dbase.com/), 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?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close