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 - /* http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
/*
    File:    GRUMPR.CH
    System:  GRUMPFISH LIBRARY
    Author:  Greg Lief
    Dialect: Clipper 5.01
    Copyright (c) 1988-91, Greg Lief
    Header file to be used in conjunction with GrumpLib @..GGET and GREAD
*/

//----- ARRAY (and optional NOEDIT) clause
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [ARRAY <array>]                                 ;
                        [<noedit:NOEDIT>]                               ;
                        [MESSAGE <message>]                             ;
                        [COLOR <color>]                                 ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, )               ;
             )                                                     ;    ;
       Atail(GetList):preblock :=                                       ;
       { | g | g:varPut(padr(<array>\[max(apick(,,,,<array>,,,,,,,,     ;
       max(ascan(<array>, trim(g:varGet())), 1)), 1)],                  ;
       len(g:varGet()))), ! <.noedit.> }                           ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | getapplykey(get, key) } ) }                       ;
       [ ; Atail(GetList):colorDisp( <color> )]                         ;
       [ ; Atail(GetList):cargo := { <message> } ]


//----- PROPER clause
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [WHEN <when>]                                   ;
                        [PROPER]                                        ;
                        [MESSAGE <message>]                             ;
                        [COLOR <color>]                                 ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}>)       ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | gkeyproper(get, key) } ) }                        ;
       [ ; Atail(GetList):colorDisp( <color> )]                         ;
       [ ; Atail(GetList):cargo := { <message> } ]


//----- LIST clause
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [LIST <list>]                                   ;
                        [WHEN <when>]                                   ;
                        [MESSAGE <message>]                             ;
                        [COLOR <color>]                                 ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}>)       ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | gkeylist(get, key) } ) }                          ;
       [ ; Atail(GetList):colorDisp( <color> )]                         ;
       [ ; Atail(GetList):cargo := { <message>, <list> } ]


//----- STEP clause
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [WHEN <when>]                                   ;
                        [STEP]                                          ;
                        [MESSAGE <message>]                             ;
                        [COLOR <color>]                                 ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}>)       ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | gkeystep(get, key) } ) }                          ;
       [ ; Atail(GetList):colorDisp( <color> )]                         ;
       [ ; Atail(GetList):cargo := { <message> } ]


//----- PASSWORD clause, using default character ("*")
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [WHEN <when>]                                   ;
                        [PASSWORD ]                                     ;
                        [MESSAGE <message>]                             ;
                        [COLOR <color>]                                 ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}>)       ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | gkeypass(get, key) } ) }                     ;    ;
       ATail(Getlist):picture := "@P*"                                  ;
       [ ; Atail(GetList):colorDisp( <color> )]                         ;
       [ ; Atail(GetList):cargo := { <message> } ]


//----- PASSWORD clause with user-defined override character
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [WHEN <when>]                                   ;
                        [PASSWORD <char>]                               ;
                        [MESSAGE <message>]                             ;
                        [COLOR <color>]                                 ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}>)       ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | gkeypass(get, key) } ) }                     ;    ;
       ATail(Getlist):picture := "@P" + <char>                          ;
       [ ; Atail(GetList):colorDisp( <color> )]                         ;
       [ ; Atail(GetList):cargo := { <message> } ]


//----- CALCULATOR clause (with message)
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [WHEN <when>]                                   ;
                        [<calc:CALCULATOR>]                             ;
                        [COLOR <color>]                                 ;
                        [MESSAGE <message>]                             ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}> )      ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | gkeycalc(get, key) } ) }                          ;
       [ ; Atail(GetList):cargo := { <message>, #<calc> } ]             ;
       [ ; Atail(GetList):colorDisp( <color> )]


//----- CALCULATOR clause (without message)
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [WHEN <when>]                                   ;
                        [<calc:CALCULATOR>]                             ;
                        [COLOR <color>]                                 ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}> )      ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | gkeycalc(get, key) } ) }                          ;
       [ ; Atail(GetList):cargo := { , #<calc> } ]                      ;
       [ ; Atail(GetList):colorDisp( <color> )]


//----- to allow SAY and GET in same statement
#xcommand @ <row>, <col> SAY <sayxpr>                                   ;
                        [<sayClauses,...>]                              ;
                        GGET <var>                                      ;
                        [<getClauses,...>]                              ;
                                                                        ;
      => @ <row>, <col> SAY <sayxpr> [<sayClauses>]                     ;
       ; @ Row(), Col()+1 GGET <var> [<getClauses>]

//----- MESSAGE clause only
#xcommand @ <row>, <col> GGET <var>                                     ;
                        [PICTURE <pic>]                                 ;
                        [VALID <valid>]                                 ;
                        [WHEN <when>]                                   ;
                        [COLOR <color>]                                 ;
                        [MESSAGE <message>]                             ;
                                                                        ;
      => SetPos( <row>, <col> )                                         ;
       ; AAdd(                                                          ;
               GetList,                                                 ;
               _GET_( <var>, <(var)>, <pic>, <{valid}>, <{when}> )      ;
             )                                                     ;    ;
       ATail(GetList):reader := { | g | GFReader(g,                     ;
       { | get, key | getapplykey(get, key) } ) }                       ;
       [ ; Atail(GetList):colorDisp( <color> )]                         ;
       [ ; Atail(GetList):cargo := { <message> } ]


//----- @..GET..RANGE (preprocessed to @..GET..VALID)

#command @ <row>, <col> GGET <var>                                      ;
                        [<clauses,...>]                                 ;
                        RANGE <lo>, <hi>                                ;
                        [<moreClauses,...>]                             ;
                                                                        ;
      => @ <row>, <col> GGET <var>                                      ;
                        [<clauses>]                                     ;
                        VALID {|_1| RangeCheck(_1,, <lo>, <hi>)}        ;
                        [<moreClauses>]

#xcommand READ                       ;
          TIMEOUT <seconds>          ;
          [EXITEVENT <exitevent>]    ;
          [WARNING <warnsecs>]       ;
          [WARNEVENT <warnevent>]    ;
          [<validation:VALIDATION>]  ;
                                  => ;
          gftimeout(1, <seconds> )                   ;
          [ ; gftimeout(2, <{exitevent}>) ]          ;
          [ ; gftimeout(3, <warnsecs>) ]             ;
          [ ; gftimeout(4, <{warnevent}>) ]          ;
          ; ReadModal( getlist )                     ;
          [; gfvalid(getlist, <.validation.>)   ]    ;
          ; getlist := {}                            ;
          ; gftimeout()

#xcommand READ VALIDATION                            ;
                                                  => ;
          ReadModal( getlist )                       ;
          ; gfvalid(getlist)                         ;
          ; getlist := {}

* eof GRUMPR.CH

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