Alpha DevCon 2018
Results 1 to 6 of 6

Thread: Rookie Function Question

  1. #1
    Member
    Real Name
    Bob M
    Join Date
    Dec 2001
    Posts
    538

    Default Rookie Function Question

    I have a character field, which must contain 17 characters (numbers and alpha combined). I tried the validation field rule using LEN(Vin)=17 but I guess that is the wrong way to make sure/validate the field contains only 17 characters.

    what would be correct, or the correct function?

    Thanks

  2. #2
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,481

    Default Re: Rookie Function Question

    What is the size of the field?

    Len(alltrim(remspecial(Vin)))=17
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    Member
    Real Name
    Bob M
    Join Date
    Dec 2001
    Posts
    538

    Default Re: Rookie Function Question

    It currently is 17, as to the field size. Makes me wonder why LEN(Vin)=17 didn't work. It accepted anything less than 17 and stops entry at 17 characters.

    I changed the validation requirement to LEN(ALLTRIM(REMSPECIAL(VIN)))=17 and it works fine. Since there are no symbols, etc, I wonder why Alpha didn't like my entry since it was only/exactly 17 characters, but not "alltrimed", so to speak. I tested 16 characters and it gave my designated error message so that seems to solve it.

    Thanks for the help, Al.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Rookie Function Question

    Makes me wonder why LEN(Vin)=17 didn't work.
    The dbf format "reserves" all 17 places of a field defined with width of 17. IOW, every record has 17 characters in the field. If you only enter 12 characters then the rest of the field is padded with space characters. The alltrim() removes those spaces in determining the data entry character count. The remspecial() removes any "punctuation" such as -_' from the character count.
    There can be only one.

  5. #5
    Member
    Real Name
    Bob M
    Join Date
    Dec 2001
    Posts
    538

    Default Re: Rookie Function Question

    Thanks, Stan.

    I suppose that is expertise from experience as I haven't found that in any guide.

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Rookie Function Question

    I don't find any explicit mention of it although the necessary trimming is alluded to in the trim() function documentation.

    https://www.alphasoftware.com/docume...20Function.xml

    At the bottom of the page at this link (www.dbase.com) there is a description of how different data types are stored in the dbf.

    http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
    Last edited by Stan Mathews; 07-10-2018 at 12:42 PM.
    There can be only one.

Similar Threads

  1. AJAX CallBack in grid (Rookie question)
    By Gustavo1478 in forum Mobile & Browser Applications
    Replies: 5
    Last Post: 04-28-2016, 04:42 PM
  2. Rookie Question - Deploying a web application to a A5 App Server Machine
    By dionmccormick in forum Application Server Version 10 - Web/Browser Applications
    Replies: 5
    Last Post: 09-30-2011, 11:04 AM
  3. Rookie xdialog question
    By lkingsella in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 06-04-2008, 10:26 PM
  4. Embarrasing rookie question-starting
    By EricN in forum Application Server Version 8
    Replies: 3
    Last Post: 07-09-2007, 03:33 PM
  5. Rookie help please
    By imwest@cox.net in forum Alpha Five Version 5
    Replies: 2
    Last Post: 02-06-2004, 09:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •