SP_SGETMANY

SGETMANY()

  Short:
  ------
  SGETMANY()    Virtual (scrolling)  gets in a popup box

  Returns:
  --------
  <lSave> => False if ESC pressed, true otherwise

  Syntax:
  -------
  SGETMANY(aGets,aDesc,nTop,nLeft,nBottom,nRight,[cTitle],[cFoot],[nPadding])

  Description:
  ------------
  READs a series of GETs in a popup box, with the
  ability to scroll the GETs up/down when there are more GETs than fit in
  the box.

  <aGets> is an array of get objects. There are two
  ways to create this:

      1.    Use GETNEW() (the Clipper function) to create each
            individual get object. Get row and column do not
            matter - they will be adjusted.

            GET postblock and preblock (valid and when)
            may be assigned as normal. As each new GET object is created,
            add it to an array.

            Pass this array as <aGets>.

      2.    Use the normal @row,col GET... commands, but to a
            location off the screen - otherwise the gets will DISPLAY
            as you are assigning them.

            @MAXROW()+1,MAXCOL()+1 GET... works for me.

  Using @...GET automatically places new get
  objects in the global array GETLIST. Pass GETLIST as <aGets>.

  <aDesc> this is an array of descriptions for each
  get. (the SAY portion). These will be displayed to the left of
  the get.

  <nTop,nLeft,nBottom,nRight> are the dimensions of the
  popup box. The Editing area will be the inside dimensions of this
  box. Make sure there's room!

  [cTitle] is a string to be used for the title.
  Displayed at <nTop>,<nLeft>+1

  [cFoot] is now ignored. This parameter used to be the footer. It
  is now just a placeholder for downward compatibility.

  [nPadding] is for the number of spaces of padding
  between the box frame and the editing area. The default is 0,
  which places the editing area at
  nTop+1,nLeft+1,nBottom-1,nRight-1. A [nPadding] of 1 would place
  the editing area at nTop+2,nLeft+2,nBottom-2,nRight-2 etc.

  Examples:
  ---------

   local i
   local aDesc := {}
   local aGets
   USE CUSTOMER
   aGets := dbf2array()

   for i = 1 to len(aGets)
     @maxrow()+1,maxcol()+1 get aGets[i]
     aadd(aDesc,field(i))
   next

   SGETMANY(getlist,aDesc,10,10,17,50,;
         "Editing","ESC quits, F10 saves",1)

  NOTES:
  -------
  Do not pass a 0 length string as a GET

  Source:
  -------
  S_GETMANY.PRG

 

SP_SBREADER

SBREADER()

  Short:
  ------
  SBREADER() Creates specialized spacebar spinner get reader
  block

  Returns:
  --------
  <bReader> => get reader block for GET

  Syntax:
  -------
  SBREADER(aValues)

  Description:
  ------------
  Creates a get reader block that allows space bar to
  rotate values from an array into the current get.

  Implement by using the SEND keyword for your
  @Say..Get.. statements.

  i.e. @10,10 say blah get blahblah SEND ;
                      reader:=SBREADER(aValues)

  <aValues> is an array of values that are of the same
  type and length as the GET.

  Examples:
  ---------
   // while in the get V1, you will be able to use the spacebar to
   // rotate values from the array

   aValues := {"Section 1","Section 2","Section 3"}
   v1 := "Section 1"
   @10,10 get v1 send reader := sbreader(aValues)
   READ

  Source:
  -------
  S_READRS.PRG

 

SP_POPUPKSET

POPUPKSET()

  Short:
  ------
  POPUPKSET() Set a popup for hotkey access from a GET

  Returns:
  --------
  Nil

  Syntax:
  -------
  POPUPKSET(nKey,cProc,cVar,bPopup)

  Description:
  ------------
  When key <nKey> is pressed while in proc or function
  <cProc> and in get/variable <cVar>, the block <bPopup> will be
  evaluated.

  If <bPopup> returns a value, it will be assigned to
  the current get.

  Be sure to clear popups with POPUPKCLR() after the
  READ.

  Examples:
  ---------
   #include "inkey.ch"

   proc test
   b1 := {||msg("Character value"),"Bert"}
   b2 := {||msg("Logical value"),.t.}
   b3 := {||msg("Date value"),date()+100}
   b4 := {||msg("Number value"),123}

   v1 := space(10)
   v2 := .f.
   v3 := ctod("  /  /  ")
   v4 := 0

   POPUPKSET(K_F1,"TEST","V1",b1)
   POPUPKSET(K_F2,"TEST","V2",b2)
   POPUPKSET(K_F3,"TEST","V3",b3)
   POPUPKSET(K_F4,"TEST","V4",b4)

   @14,10 get v1      // if F1 is pressed here, b1 will be evaluated
   @15,10 get v2      // if F2 is pressed here, b2 will be evaluated
   @16,10 get v3      // if F3 is pressed here, b3 will be evaluated
   @17,10 get v4      // if F4 is pressed here, b4 will be evaluated

   read

   POPUPKCLR()

  Source:
  -------
  S_POPUPK.PRG

 

 

C5 UI – GET System

C5 UI – GET System

Standard :

@…GET :

Create a new Get object and display it on the screen

@ <nRow>, <nCol>
    [SAY <exp>
    [PICTURE <cSayPicture>]
    [COLOR <cColorString>]]
    GET <idVar>
    [PICTURE <cGetPicture>]
    [COLOR <cColorString>]
    [WHEN <lPreExpression>]
    [RANGE* <dnLower>, <dnUpper>] |
    [VALID <lPostExpression>]

CLEAR GETS :

Release Get objects from the current GetList array

CLEAR GETS

READ :

Activate full-screen editing mode using Get objects

READ [SAVE]

READEXIT() :

Toggle Uparrow and Downarrow as READ exit keys

READEXIT([<lToggle>]) --> lCurrentState

READINSERT() :

Toggle the current insert mode for READ and MEMOEDIT()

READINSERT([<lToggle>]) --> lCurrentMode

READKEY()* :

Determine what key was used to terminate a READ

READKEY() --> nReadkeyCode

READMODAL() :

Activate a full-screen editing mode for a GetList

READMODAL(<aGetList>) --> NIL

READVAR() :

Return the current GET/MENU variable name

READVAR() --> cVarName

SET ESCAPE :

Toggle Esc as a READ exit key

SET ESCAPE ON | off | <xlToggle>

SET FORMAT :

Activate a format when READ is executed

SET FORMAT TO [<idProcedure>[.<ext>]]

SET INTENSITY :

Toggle enhanced display of GETs and PROMPTs

SET INTENSITY ON | off | <xlToggle>

SET SCOREBOARD :

Toggle the message display from READ or MEMOEDIT()

SET SCOREBOARD ON | off | <xlToggle>

UPDATED() :

Determine if any GET changed during a READ

UPDATED() --> lChange

Advanced ( Getsys.prg Functions ) :

GETACTIVE() :

Return the currently active Get object

GETACTIVE() --> objGet

GETAPPLYKEY() :

Apply a key to a Get object from within a Get reader

GETAPPLYKEY(<oGet>, <nKey>) --> NIL

GETDOSETKEY() :

Process SET KEY during Get editing

GETDOSETKEY(<oGet>) --> NIL

GETPOSTVALIDATE() :

Postvalidate the current Get object

GETPOSTVALIDATE(<oGet>) --> lSuccess

GETPREVALIDATE() :

Prevalidate a Get object

GETPREVALIDATE(<oGet>) --> lSuccess

GETREADER() :

Execute standard READ behavior for a Get object

GETREADER(<oGet>) --> NIL

READFORMAT() :

Return, and optionally set, the format file code block

READFORMAT([<bFormat>]) --> bCurrentFormat

READKILL() :

Return, and optionally set, the READ terminate flag

READKILL([<lKillRead>]) --> lCurrentSetting

READUPDATED() :

Return, and optionally set, whether a Get changed

READUPDATED([<lChanged>]) --> lCurrentSetting

GET Class

C5_READ

 READ
 Activate full-screen editing mode using Get objects
------------------------------------------------------------------------------
 Syntax

     READ [SAVE] [MENU <oMenu>] [MSG AT <nRow>, <nLeft>,
        <nRight>] [MSG COLOR <cColorString>]

 Arguments

     SAVE retains the contents of the current GetList after the READ
     terminates.  Later, you can edit the same Get objects by issuing another
     READ.  If not specified, the current GetList is assigned an empty array
     deleting all of the previous Get objects when the READ terminates.

     MENU <oMenu> specifies an optional Topbarmenu object that, when
     supplied, permits menu selection during data entry.

     MSG AT <nMsgRow>, <nMsgLeft>, <nMsgRight> specify the row,
     left, and right margins where the Get object messages appear on the
     screen.  If omitted, messages will not appear.

     MSG COLOR <cMsgColor> defines the color setting of the message area.
     It consists of a single foreground/background color pair.

 Description

     READ executes a full-screen editing mode using all Get objects created
     and added to the current GetList since the most recent CLEAR, CLEAR
     GETS, CLEAR ALL or READ commands.  If there is a format procedure
     active, READ executes that procedure before entering the full-screen
     editing mode.

     Within a READ, the user can edit the buffer of each Get object as well
     as move from one Get object to another.  Before the user can enter a Get
     object, control passes to the associated WHEN <lPreCondition> if one has
     been assigned to that Get object.  If <lPreCondition> returns true
     (.T.), the user is allowed to edit the buffer of the Get object.
     Otherwise, control passes to the next Get object in the GetList.  Within
     a GET buffer, the user can edit using the full complement of editing and
     navigation keys.  See the tables below.

     When the user presses a GET exit key, control passes to the associated
     RANGE or VALID postcondition if one has been specified.  If either
     condition returns true (.T.), editing of the Get object is terminated
     and control passes to the next Get object.  Otherwise, control remains
     within the current Get object until a valid value is entered or the user
     presses the Esc key.

     When the user successfully enters a value into a Get object, the
     associated variable is assigned the value of the Get object's buffer.

     The following tables list active keys within a READ:

     READ Navigation Keys
     ------------------------------------------------------------------------
     Key                           Action
     ------------------------------------------------------------------------
     Left arrow, Ctrl+S            Character left. Does not move cursor to
                                   previous GET.
     Right arrow, Ctrl+D           Character right.  Does not move cursor to
                                   next GET.
     Ctrl+Left arrow, Ctrl+A       Word left.
     Ctrl+Right arrow, Ctrl+F      Word right.
     Up arrow, Shift+Tab, Ctrl+E   Previous GET.
     Down arrow, Tab, Ctrl+X,      Return, Ctrl+M Next GET.
     Home                          First character of GET.
     End                           Last character of GET.
     Ctrl+Home                     Beginning of first GET.
     ------------------------------------------------------------------------

     READ Editing Keys
     ------------------------------------------------------------------------
     Key                 Action
     ------------------------------------------------------------------------
     Del, Ctrl+G         Delete character at cursor position
     Backspace, Ctrl+H   Destructive backspace
     Ctrl+T              Delete word right
     Ctrl+Y              Delete from cursor position to end of GET
     Ctrl+U              Restore current GET to original value
     ------------------------------------------------------------------------

     READ Toggle Keys
     ------------------------------------------------------------------------
     Key            Action
     ------------------------------------------------------------------------
     Ins, Ctrl+V    Toggle insert mode
     ------------------------------------------------------------------------

     READ Exit Keys
     ------------------------------------------------------------------------
     Key                           Action
     ------------------------------------------------------------------------
     Ctrl+W, Ctrl+C, PgUp, PgDn    Terminate READ saving current GET
     Return, Ctrl+M                Terminate READ from last GET
     Esc                           Terminate READ without saving current GET
     Up arrow                      Terminate READ from first GET if
                                   READEXIT()=.T.
     Down arrow                    Terminate READ from last GET if
                                   READEXIT()=.T.
     ------------------------------------------------------------------------

 Notes

     .  Nested READs: To perform a nested READ within a SET KEY,
        VALID, or WHEN procedure or user-defined function, declare or create
        a new GetList, perform a series of @...GET statements, and then READ.
        When the procedure terminates, the new GetList is released and the
        previous GetList becomes visible again.  See the example below.

     .  Quick keys: Pressing Home or End in quick succession goes to
        the first or last nonblank character in a Get object's buffer.

     .  Terminating a READ: A READ is terminated by executing a BREAK,
        CLEAR, CLEAR GETS, or CLEAR ALL from within a SET KEY procedure or a
        user-defined function initiated by VALID.

     .  UPDATED(): If any Get object buffer was changed during the
        current READ, UPDATED() is set to true (.T.).

 Examples

     .  This example defines several GETs then READs them:

        CLEAR
        cVar1 := cVar2 := cVar3 := SPACE(10)
        @ 10, 10 SAY "Variable one:" GET cVar1 VALID ;
              !EMPTY(cVar1)
        @ 11, 10 SAY "Variable two:" GET cVar2 ;
                 WHEN RTRIM(cVar1) !=  "One"
        @ 12, 10 SAY "Variable three:" GET cVar3 VALID ;
                 !EMPTY(cVar3)
        READ

     .  This example performs a nested READ within a SET KEY, WHEN, or
        VALID procedure or user-defined function:

        LOCAL cName := SPACE(10)
        @ 10, 10 GET cName VALID SubForm( cName )
        READ
        RETURN

        FUNCTION SubForm( cLookup )
           LOCAL GetList := {}         // Create new GetList
           USE Sales INDEX Salesman NEW
           SEEK cLookup
           IF FOUND()
              @ 15, 10 GET Salesman    // Add Get objects to
              @ 16, 10 GET Amount      // new GetList
              READ                     // READ from new GetList
           ENDIF
           CLOSE Sales
           RETURN .T.                  // Release new GetList

 Files   Library is CLIPPER.LIB.

See Also: @…GET @…SAY CLEAR GETS LASTKEY() READEXIT()



C5 Commands

 ?|??            Display one or more values to the console
 @...BOX         Draw a box on the screen
 @...CLEAR       Clear a rectangular region of the screen
 @...GET         Create a new Get object and display it
 @...PROMPT      Paint a menu item and define a message
 @...SAY         Display data at a specified screen or printer row and column
 @...TO          Draw a single- or double-line box
 ACCEPT*         Place keyboard input into a memory variable
 APPEND BLANK    Add a new record to the current database file
 APPEND FROM     Import records from a database (.dbf) file or ASCII text file
 AVERAGE         Average numeric expressions in the current work area
 CALL*           Execute a C or Assembler procedure
 CANCEL*         Terminate program processing
 CLEAR ALL*      Close files and release public and private variables
 CLEAR GETS      Release Get objects from the current GetList array
 CLEAR MEMORY    Release all public and private variables
 CLEAR SCREEN    Clear the screen and return the cursor home
 CLEAR TYPEAHEAD Empty the keyboard buffer
 CLOSE           Close a specific set of files
 COMMIT          Perform a solid-disk write for all active work areas
 CONTINUE        Resume a pending LOCATE
 COPY FILE       Copy a file to a new file or to a device
 COPY STRUCTURE  Copy the current .dbf structure to a new database (.dbf) file
 COPY STRU EXTE  Copy field definitions to a .dbf file
 COPY TO         Export records to a database (.dbf) file or ASCII text file
 COUNT           Tally records to a variable
 CREATE          Create an empty structure extended (.dbf) file
 CREATE FROM     Create a new .dbf file from a structure extended file
 DELETE          Mark records for deletion
 DELETE FILE     Remove a file from disk
 DELETE TAG      Delete a tag
 DIR*            Display a listing of files from a specified path
 DISPLAY         Display records to the console
 EJECT           Advance the printhead to top of form
 ERASE           Remove a file from disk
 FIND*           Search an index for a specified key value
 GO              Move the pointer to the specified identity
 INDEX           Create an index file
 INPUT*          Enter the result of an expression into a variable
 JOIN            Create a new database file by merging from two work areas
 KEYBOARD        Stuff a string into the keyboard buffer
 LABEL FORM      Display labels to the console
 LIST            List records to the console
 LOCATE          Search sequentially for a record matching a condition
 MENU TO         Execute a lightbar menu for defined PROMPTs
 NOTE*           Place a single-line comment in a program file
 PACK            Remove deleted records from a database file
 QUIT            Terminate program processing
 READ            Activate full-screen editing mode using Get objects
 RECALL          Restore records marked for deletion
 REINDEX         Rebuild open indexes in the current work area
 RELEASE         Delete public and private memory variables
 RENAME          Change the name of a file
 REPLACE         Assign new values to field variables
 REPORT FORM     Display a report to the console
 RESTORE         Retrieve memory variables from a memory (.mem) file
 RESTORE SCREEN* Display a saved screen
 RUN             Execute a DOS command or program
 SAVE            Save variables to a memory (.mem) file
 SAVE SCREEN*    Save the current screen to a buffer or variable
 SEEK            Search an order for a specified key value
 SELECT          Change the current work area
 SET ALTERNATE   Echo console output to a text file
 SET BELL        Toggle sounding of the bell during full-screen operations
 SET CENTURY     Modify the date format to include or omit century digits
 SET COLOR*      Define screen colors
 SET CONFIRM     Toggle required exit key to terminate GETs
 SET CONSOLE     Toggle console display to the screen
 SET CURSOR      Toggle the screen cursor on or off
 SET DATE        Set the date format for input and display
 SET DECIMALS    Set the number of decimal places to be displayed
 SET DEFAULT     Set the CA-Clipper default drive and directory
 SET DELETED     Toggle filtering of deleted records
 SET DELIMITERS  Toggle or define GET delimiters
 SET DESCENDING  Change the descending flag of the controlling order
 SET DEVICE      Direct @...SAYs to the screen or printer
 SET EPOCH       Control the interpretation of dates with no century digits
 SET ESCAPE      Toggle Esc as a READ exit key
 SET EXACT*      Toggle exact matches for character strings
 SET EXCLUSIVE*  Establish shared or exclusive USE of database files
 SET FILTER      Hide records not meeting a condition
 SET FIXED       Toggle fixing of the number of decimal digits displayed
 SET FORMAT*     Activate a format when READ is executed
 SET FUNCTION    Assign a character string to a function key
 SET INDEX       Open one or more order bags in the current work area
 SET INTENSITY   Toggle enhanced display of GETs and PROMPTs
 SET KEY         Assign a procedure invocation to a key
 SET MARGIN      Set the page offset for all printed output
 SET MEMOBLOCK   Change the block size for memo files
 SET MESSAGE     Set the @...PROMPT message line row
 SET OPTIMIZE    Change the setting that optimizes using open orders
 SET ORDER       Select the controlling order
 SET PATH        Specify the CA-Clipper search path for opening files
 SET PRINTER     Toggle echo of output to printer or set the print destination
 SET PROCEDURE*  Compile procedures and functions into the current object file
 SET RELATION    Relate two work areas by a key value or record number
 SET SCOPE       Change the boundaries for scoping keys in controlling order
 SET SCOPEBOTTOM Change bottom boundary for scoping keys in controlling order
 SET SCOPETOP    Change top boundary for scoping keys in controlling order
 SET SCOREBOARD  Toggle the message display from READ or MEMOEDIT()
 SET SOFTSEEK    Toggle relative seeking
 SET TYPEAHEAD   Set the size of the keyboard buffer
 SET UNIQUE*     Toggle inclusion of non-unique keys into an index
 SET WRAP*       Toggle wrapping of the highlight in menus
 SKIP            Move the record pointer to a new position
 SORT            Copy to a database (.dbf) file in sorted order
 STORE*          Assign a value to one or more variables
 SUM             Sum numeric expressions and assign results to variables
 TEXT*           Display a literal block of text
 TOTAL           Summarize records by key value to a database (.dbf) file
 TYPE            Display the contents of a text file
 UNLOCK          Release file/record locks set by the current user
 UPDATE          Update current database file from another database file
 USE             Open an existing database (.dbf) and its associated files
 WAIT*           Suspend program processing until a key is pressed
 ZAP             Remove all records from the current database file

 

Introduction GET/READ Functions

 Introduction

     Clipper enables you to program nested  GET/READ masks.  The functions
     in this chapter are retained in Clipper Tools for compatibility
     reasons and to make them easy to use.

     The active GET is saved with the help of a character string and restored
     through this string later.  This allows you to newly query inputs
     without losing your main input mask.  You can save KEYTRAP() definitions
     the same way and redefine them as you wish.

     Important!  It is impossible to use the saved information any longer
     that the runtime of an application.  The character string that results
     cannot be saved to a file and reloaded later.

     Other functions in this chapter return information about GET fields,
     such as screen position, the names of the accompanying variables, or
     information about whether a field is currently active.

Faster Migration

Quick Start to Migration

Chapter I – Text to text conversion

Section 2 – Faster Migration

Well …

Forget about all those mysterious DOS / console / command modes, batch processing, etc.

If you have tongs, don’t burn your hand!

Yes we have; so let’s use it:

Step : 1

Begin with making / assigning  a folder for your works; FE : C:\MyWorks

Note : Working in a separate and clean folder is important.

Step : 2

Build a “Harbour Project”  file : say MyTest01.hbp; and put a line into it :

My1stProg.prg

Step : 3

Build a a program  file : say My1stProg.prg ; and write your very first program:

REQUEST HB_GT_WIN_DEFAULT
PROCEDURE Main
   SETMODE( 25, 80 )
   CLIENTE = SPACE( 15 )
   @ 10, 15 SAY "Customer : " GET CLIENTE
   READ
   @ 12, 0
   ? CLIENTE
   WAIT
RETURN

Step : 4

Open your .hbp file with HMG-IDE and press “Run” button.

VeryFirstHarbourProject

That’s all !

Any other problem / question ?

Happy HMG’ing 😀

 

 

 

 

 

 

 

 

Code blocks, inside and out

 

Code blocks, inside and out