Danny A. del Pilar

Contributed works of Danny A. del Pilar

Browse Test Demo

Easter Sunday Calculation

Generate Gregorian Calendar

HMG source code converter

How to build menu like old ACHOICE function?

KPI (Key Performance Indicator) Dashboard

Return value from modal window (Record Picker) 

Similar SCATTER / GATHER en HMG

MOL (Marek Olszewski)

Contributed samples by MOL (Marek Olszewski)

Backup-Restore

Billing System ( definable buttons )

Calculator

Copy To Clipboard

Deactivate menu

Debug Message

Download from www

EAN13 BarCode Generator

Filter in Browse

HMG with MS SQL server

Incremental Search in BROWSE 

Menu like ACHOICE

Moldruk (Print like DOS )

Set Status Bar Item

Send mails via SMTP

Using ProgressBar as a graph

HB_Alert

HB_Alert

Displays a text-mode dialog box with a message.

Syntax

      HB_Alert( <xMessage>, [<aOptions>], [<cColor>], [<nDelay>] ) --> nChoice

Arguments

<xMessage> : The message to display. May be any data type. Character string may be divided display lines by the semicolon

<aOptions> : An array with available response as character strings. Default is { “Ok” }.

<cColor> : A string as color codes. Default color is “W+/R”.

<nDelay> : Number of seconds to wait to user response before abort. Default value is 0, that wait forever.

Returns

A numeric value indicating the ordinal position within <aOption> selected by the user. Zero value means that user pressed escape key.

If <nDelay> is specified and this number of seconds has elapsed without a key press, the return value is 1.

Description

HB_Alert() displays a dialog box and lets the user select an option. The user can move a highlight bar using arrow keys or the TAB key. To select an option, the user can press ENTER, SPACE or the first letter of an option.

HB_Alert() is extended version of Alert() to support all variables types (not just strings) is passed as first parameter.

Example

      // This example displays a message with two line : file name and 'not found' message.
      // After 15 seconds without user response, assumed 'Abort' selected.

      FUNCTION FNFMessage( cFileName )

         LOCAL cMessage, aOptions, nChoice

         aMessage := { cFileName, 'Not found !' }
         aOptions :=  { 'Abort', 'Retry', 'Skip' }

         nChoice := HB_Alert( aMessage, aOptions, , 15 )

      RETURN nChoice // FNFMessage()

Seealso

@…PROMPT, AChoice(), Alert(), DispBox(), DispOut(), MENU TO

REQUEST

REQUEST

Declare a module request list

Syntax

      REQUEST <name1> [,<nameN>]

Arguments

<idModule list> is the list of modules that will be linked into the current executable (.EXE) file.

Description

REQUEST is a declaration statement that defines a list of module identifiers to the linker. Like all other declaration statements, a REQUEST statement must be specified before any executable statements in either the program file, or a procedure or user-defined function definition.

During the compilation of Clipper source code, all explicit references to procedures and user-defined functions are made to the linker. In some instances, within a source file, there may be no references made to procedure or user-defined function names until runtime. REQUEST resolves this situation by forcing the named procedures or user-defined functions to be linked even if they are not explicitly referenced in the source file. This is important in several instances:

. Procedures, user-defined functions, or formats referenced with macro expressions or variables

. Procedures and user-defined functions used in REPORT and LABEL FORMs and not referenced in the source code

. User-defined functions used in index keys and not referenced in the source code

. ACHOICE(), DBEDIT(), or MEMOEDIT() user functions

. Initialization procedures declared with the INIT PROCEDURE statement

. Exit procedures declared with the EXIT PROCEDURE statement

To group common REQUESTs together, place them in a header file and then include (#include) the header file into each program file (.prg) that might indirectly use them.

Examples

      .  This example shows a typical header file consisting of common
         REQUESTs for REPORT FORMs:
      // Request.ch

      REQUEST HARDCR
      REQUEST TONE
      REQUEST MEMOTRAN
      REQUEST STRTRAN

      OR :

      REQUEST HARDCR, TONE, MEMOTRAN, STRTRAN

Seealso

ACHOICE(), ANNOUNCE, DBEDIT(), EXIT, PROCEDURE; EXTERNAL*

Harbour All Functions – A

AAdd
Abs
AChoice
AClone
ACopy
ACos

ADays
AddASCII
AddMonth
ADel
ADir
AfterAtNum
AEval
AFields
AFill
AIns
Alert
Alias
AllTrim

AMonths
Array
Asc
AScan
ASCIISum
ASCPos
ASin
ASize
ASort
At
AtAdjust
ATail
ATan
ATn2
AtNum
AtRepl
AtToken

MENU TO

MENU TO

Invoked a menu defined by set of @…PROMPT

Syntax

      MENU TO <cVariable>

Arguments

<cVariable> is a character string that contain the name of the variable to hold the menu choices, if this variable does not exist a PRIVATE variable with the name <cVariable> would be created to hold the result.

Description

Menu To() invoked the menu define by previous __AtPrompt() call and display a highlight bar that the user can move to select an option from the menu. If <cVariable> does not exist or not visible, a PRIVATE variable named <cVariable> is created and hold the current menu selection. If there is a variable named <cVariable>, its value is used to select the first highlighted item.

Menu prompts and messages are displayed in current Standard color, highlighted bar is displayed using current Enhanced color.

Pressing the arrow keys move the highlighted bar. When a menu item is highlighted the message associated with it is displayed on the line specified with SET MESSAGE. If SET WRAP is ON and the user press UP arrow while on the first selection the last menu item is highlighted, if the user press Down arrow while on the last item, the first item is highlighted.

Following are active keys that handled by Menu To:

       key            Meaning
       -------------- ---------------------------------
       Up             Move to previous item
       Down           Move to next item
       Left           Move to previous item
       Right          Move to next item
       Home           Move to the first item
       End            Move to the last item
       Page-Up        Select menu item, return position
       Page-Down      Select menu item, return position
       Enter          Select menu item, return position
       Esc            Abort selection, return 0
       First letter   Select next menu with the same first letter,
                      return this item position.

Upon exit the cursor is placed at MaxRow()-1, 0 Menu To can be nested without loosing the previous prompts.

MENU TO command is preprocessed into __MenuTo() function during compile time.

Examples

      // display menu item on each screen corner and let user select one
      CLS
      SET MESSAGE TO MaxRow() / 2 CENTER
      SET WRAP ON
      @ 0           , 0             PROMPT "1. Upper left"   MESSAGE " One "
      @ 0           , MaxCol() - 16 PROMPT "2. Upper right"  MESSAGE " Two "
      @ MaxRow() - 1, MaxCol() - 16 PROMPT "3. Bottom right" MESSAGE "Three"
      @ MaxRow() - 1, 0             PROMPT "4. Bottom left"  MESSAGE "Four "
      MENU TO nChoice
      SetPos( MaxRow() / 2, MaxCol() / 2 - 10 )
      IF nChoice == 0
         ?? "Esc was pressed"
      ELSE
         ?? "Selected option is", nChoice
      ENDIF

Compliance

Clipper

Seealso

@…PROMPT, ACHOICE(), SET MESSAGE, SET INTENSITY, SET WRAP, __ATPROMPT()