Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Really appreciate your site. Really good site for learning what others do when they run into problems. You guy's are great!!!..."

Geography

Where in the world do Tek-Tips members come from?

Question: Validation on fields where different because of spaces.Helpful Member! 

BlueRoses (Programmer)
28 Nov 00 18:10
Okay, I'm totally stumped, working on my Senior project and desparately need help!

This is what I need to do.  I have a name1 and a field name2.

I already have checked to see if they are spaces and if they are the same.  Now I need to check if they are different to make sure the difference isn't just an unwanted space.

I figured I would use a loop to "suck the spaces" out of each field and compare the exact alphabetic structured fields, but I'm not sure of the way to write it and how to write out the field if they truly are "different" in it's original form.

PLEASE HELP, FAST!

Helpful Member!  Crox (Programmer)
28 Nov 00 18:27
You can build a shift left on more than one space.

Something like:

  PERFORM VARYING SUB-1 FROM 1 BY 1 UNTIL SUB-1 > LENGTH OF NAME-1 - 3
     IF NAME-1(SUB-1:2) = SPACE
         NAME-1(SUB-1:) = NAME-1 (SUB-1 + 1:)
     END-IF
  END-PERFORM

I didn't test this and the compiler can complain about overlapping fields ... bla bla etc. but that doesn't matter, just bringing back more than one space into just a single one. After that doing this also with name-2, you should be able to compare them.

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!

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