Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - ~bispostcode()~b http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
~BISPOSTCODE()~B
    This function provides basic validation for Canadian postal codes.

    Syntax

    ISPOSTCODE(@<state>, @<postal code>)

    Required Parameters

    <state> and <postal code> are both character expressions. They must
    both be passed by reference (i.e., preceded by "@").

    Return Value

    ISPOSTCODE() returns a logical value: True (.T.) if the postal code
    is valid, False (.F.) if it is not.

    Notes

    ISPOSTCODE() performs four tests:

    1) It verifies that the length of the postal code is seven.
    2) It verifies the format to be "X9X 9X9".
    3) It ensures that the following letters are not in the postal code
       (unless at the beginning): D, F, I, O, Q, and U.
    4) Finally, it checks the first character against an array of
    territory codes to make sure that it matches the province.

    Sample Usage

    mstate = SPACE(2)                                                      
    mpostcode = SPACE(10)                                                  
    @ 20, 0 GET mstate PICTURE "@!"                                        
    @ 21,0 GET mpostcode PICTURE "@!" VALID ISPOSTCODE(@mstate, @mpostcode)
    READ                                                                   

See Also: ISSTATE()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson