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 - <b>calc_pic()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CALC_PIC()

    CALC_PIC() allows you to simulate calculator-style data entry; i.e.
    numbers are entered from right to left instead of left to right.
    It is to be used in conjunction with a PICTURE clause.

    Syntax

    ... PICTURE CALC_PIC(@<number>, <picstring>)

    <number> is the numeric expression that you are GETting, and this
    must be passed by reference (i.e., prefaced by an At ("@") sign.).

    <picstring> is a character string representing the PICTURE string
    that you wish to use.

    Return Value

    Because CALC_PIC() is designed exclusively for use with a PICTURE
    clause, it must return a character string to conform with the
    inherent requirements of a PICTURE clause.  Because you are passing
    the numeric variable by reference, it is changed directly within
    CALC_PIC() and thus does not need to be returned from it.

    Caveat

    By design, CALC_PIC() can only be used with one GET and one READ.
    For example, if you are GETting ten variables on the same READ, and
    one of those variables uses CALC_PIC() as the PICTURE clause, the
    cursor will jump to that variable no matter where it is in the
    list.  This is unavoidable because, unlike a VALID clause which
    is processed only after passing through the corresponding GET, all
    PICTURE clauses are processed before control is passed to the READ
    statement.

    Sample Usage

    mcost = 0.00                                         
    @ 12, 20 GET mcost PICTURE CALC_PIC(@mcost, "###.##")
    READ                                                 

See Also: UP_N_DOWN()

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