Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: ed fabonan
  
 
 
 ed fabonan
 To: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 Tags
Subject: RE: delayng withs spaces
Thread ID: 33741 Message ID: 33753 # Views: 2 # Ratings: 0
Version: Visual FoxPro 8 Category: Databases, Tables and SQL Server
Date: Wednesday, December 03, 2003 1:12:42 AM         
   


> I would validate the user input and change the ID appropriately, like ABC21 be changed to ABC0021.
>
> > Hi,
> > I've a products table who has a id field. I want this field to contain values such as 'ABC1234', but the length of the last four character may change, for example, i could have ab id as 'ABC21'
> > To do this I'd put a character(7) field the format mask !!!NNNN and this works, but i've a problem when the user has to input a shorter value (such as the second example), because he has also to type the blank spaces, otherwise he can't locate the record....
> > I tried with the T letter in the format property of the field, but the datatype is "character", not "varchar" like in other databases.... right?
> >
> > Any idea???
> >
> >
> > Thanks!
Or you could pad the field with blanks in the valid method with PADR(). It may be necessary to SET EXACT OFF so that comparisons between strings with and without the trailing blanks would still lead you the the required record.

ENTIRE THREAD

delayng withs spaces Posted by matiass emanuel @ 12/2/2003 6:02:35 PM
RE: delayng withs spaces Posted by Yuri Rubinov @ 12/2/2003 7:39:15 PM
RE: delayng withs spaces Posted by ed fabonan @ 12/3/2003 1:12:42 AM
RE: delayng withs spaces Posted by lucy alice pilanga @ 12/3/2003 4:47:53 AM
RE: delayng withs spaces Posted by lucy alice pilanga @ 12/3/2003 5:06:07 AM
RE: delayng withs spaces Posted by Pete Sass @ 12/4/2003 8:00:44 PM