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

File Name Manipulation

File Name Manipulation Functions

HB_FNameDir Extract Folder name from file specification
HB_FNameName Extract File name from file specification
HB_FNameNameExt Extract File name and extention from file specification
HB_FNameExt Extract File extention from full file specification
HB_FNameExtSet Returns changed file extension from file specification
HB_FNameMerge Composes a full file specification from individual components
HB_FNameSplit Extract folder, file, extension from full file specification

File Find Functions

File Find Functions

FileFindAttr Get attributes of a file found by FileFindFirst() or FileFindNext()
FileFindDate Get date of a file found by FileFindFirst() or FileFindNext()
FileFindFirst Searches for files by name and attribute
FileFindName Get name of a file found by FileFindFirst() or FileFindNext()
FileFindNext Searches next file found by FileFindFirst() or FileFindNext()
FileFindSize Get size of a file found by FileFindFirst() or FileFindNext()
FileFindTime Get time of a file found by FileFindFirst() or FileFindNext()

File Management

File Management Function

DeleteFile Deletes an error-tolerant file
ExeName Full File Name of Executable ( Application )
File Tests for the existence of file(s)
FileMove Moves file(s) to another directory
FileDelete Deletes file(s) by name and attribute
FileSeek Searches for files by name and attribute
HB_FNameExists Detect File / Folder existence
HB_ProgName Returns name and directory of the current Harbour program
HB_FileExists Tests for the existence of a file
HB_FileMatch Makes a file comparison with mask
HB_FTempCreate Creates and opens a temporary file
HB_FTempCreateEx Creates and opens a temporary file with extension
RenameFile Fault tolerant renaming of a file
TempFile Creates a file for temporary use

Low-Level File Access

Low-Level File Access Functions

FClose Closes a file opened by low-level access
FCreate Creates a file for low-level access
FErase Erase any file from disk by low-level access
FError Reports the error status of low-level file functions
FOpen Open a file for low-level access
FRead Reads bytes from a file opened with low-level access
FReadStr Reads a string from a file opened with low-level access
FRename Renames a file by low-level access
FSeek Positions the file pointer in a file opened with low-level access
FWrite Writes characters to a file opened with low-level access

Path & Folder Functions

Path & Folder Functions

ADir* Fill pre-defined arrays with file/directory information
CurDir Returns the current OS directory name
DirChange Changes the current OS directory
Directory Build an array of Directory and file information
DirMake Creates a directory
DirName Determines the name of the current directory
DirRemove Attempt to remove a directory with subdirectories
FileSeek Searches for files by name and attribute
HB_CWD Change Working Directory
HB_DirBase Drive and directory name of running executable ( application )
HB_DirBuild Creates a directory
HB_DirCreate Creates a directory
HB_DirDelete Attempt to remove a directory
HB_DirExists Tests for the existence of a directory
HB_DirScan Scan a directory tree and build a files and folders list
HB_DirTemp Returns name of temp dir of system / user
HB_DirUnbuild Attempt to remove a directory
HB_PathNormalize Normalizes the path designation by converting relative path to absolute
HB_DirSepAdd Add a dir separator to end of a path when its missing
HB_DirSepDel Delete dir separator at end of a path if exists
HB_DirSepToOS Convert dir separators in a path to OS standard dir separators
IsDir Checks if a character string contains the name of an existing directory.
IsDirectory Checks if a character string contains the name of an existing directory.
MakeDir Create a new directory
TrueName Standardizes the path designation by converting relative path to absolute