@…CLEAR

@…CLEAR

Clear a rectangular region of the screen

Syntax

       @ <nTop>, <nLeft> [CLEAR
              [TO <nBottom>, <nRight>]]
              [DOUBLE] [COLOR <cColor>]

Arguments

<nTop> and <nLeft> define the upper-left corner coordinate.

TO <nBottom>, <nRight> defines the lower-right corner coordinates of the screen region to CLEAR. If the TO clause is not specified, these coordinates default to MAXROW() and MAXCOL().

Description

@…CLEAR erases a rectangular region of the screen by filling the specified region with space characters using the current standard color setting. After @…CLEAR erases the designated region, the cursor is located in the upper corner of the region at <nTop> + 1 and <nLeft> + 1. ROW() and COL() are also updated to reflect the new cursor position.

Examples

       .  This example erases the screen from 10, 10 to 20, 40, painting
       the region blue and then displaying a bright cyan box on blue:

       SETCOLOR("BG+/B")
       @ 10, 10 CLEAR TO 20, 40
       @ 10, 10 TO 20, 40

Sealso

@…BOX, CLEAR SCREEN, SCROLL(), SETCOLOR()

@…BOX

@…BOX

Draw a box on the screen

Syntax

       @ <nTop>, <nLeft>, <nBottom>, <nRight>
              BOX <cBoxString> [COLOR <cColorString>]

Arguments

<nTop>, <nLeft>, <nBottom>, <nRight> define the coordinates of the box. @…BOX draws a box using row values from zero to MAXROW(), and column values from zero to MAXCOL(). If <nBottom> and <nRight> are larger than MAXROW() and MAXCOL(), the bottom-right corner is drawn off the screen.

BOX <cBoxString> defines a string of eight border characters and a fill character. If <cBoxString> is specified as a single character, that character draws the whole box.

COLOR <cColorString> defines the display color of the drawn box. If not specified, the box is drawn using the standard color setting of the current system color as defined by SETCOLOR(). Note that <cColorString> is a character expression containing the standard color setting. If you want to specify a literal color setting, enclose it within quote marks.

Description

@…BOX draws a box on the screen using configurable border and fill characters. @…BOX draws the box using <cBoxString> starting from the upper left-hand corner, proceeding clockwise and filling the screen region with the ninth character. If the ninth character is not specified, the screen region within the box is not painted. Existing text and color remain unchanged.

After @…BOX executes, the cursor is located in the upper corner of the boxed region at <nTop> + 1 and <nLeft> + 1. ROW() and COL() are also updated to reflect the new cursor position.

Examples

       .  These examples draw two boxes using box manifest constants
       defined in the supplied header file, Box.ch.  The first example draws
       a box using the specified characters for the border, but leaves all
       other areas of the screen intact.  The second example draws the same
       box filling the box region with space characters.

       #include "Box.ch"
       // Draw a box with a double-line top with a
       // single-line side
       @ 1, 1, 22, 79 BOX B_DOUBLE_SINGLE
       // Draw the same box filling the box region with
       // spaces
       @ 1, 1, 22, 79 BOX B_DOUBLE_SINGLE + SPACE(1)

Files

Header file is Box.ch.

Seealso

@…CLEAR, @…TO, DISPBOX(), SCROLL()

Index fundemantals

Question : I just would like to understand a bit what is the difference between DBFNSX and SIXCDX, please. Are not  they the same thing?

Answer : I described it few times in the past.

Lets forget about SIXCDX – it’s slighlt modified DBFCDX not worth to talk about.

DBT, FMT, SPT are different MEMO formats. All of them are supported by Harbour and automatically recognized when DBF file is open. NTX, CDX and NSX are different index formats. They can be used in any combinations of MEMO formats, i.e. DBFCDX perfectly well works with DBT memo files just like with FPT and SMT ones.

In Harbour all core RDDs using above index formats (DBFNSX, DBFCDX, DBFNSX) have nearly the same functionality which cover nearly all index feautres known in xbase world and many of them are unique to [x]Harbour only so they are not supported by other drivers.

With all above RDDs user can use all ord*(), db*(), sx_*(), hsx_*() , … functions, can create multitag indexes (many orders in single file, also for NTX format), autooreder, autoopen, production indexes, etc. so for programmer used RDD should not create any difference. It’s also possible to enable disable some features using RDDI_* interface, i.e. this code change default DBFNTX behavior so it behaves just like DBFCDX and even uses “.cdx” as default file extnesion (of course internally it’s still NTX format with Harbour extenssions – we support CTX format from CLIP)

 // default index extenssion 
 rddInfo( RDDI_ORDBAGEXT, ".cdx", "DBFNTX" ) 
 //support multi tag in single index file 
 rddInfo( RDDI_MULTITAG , .t. , "DBFNTX" ) 
 // structural indexes support 
 rddInfo( RDDI_STRUCTORD, .t. , "DBFNTX" ) 
 // record number is hidden trailing part of key duirng sorted 
 rddInfo( RDDI_SORTRECNO, .t. , "DBFNTX" )

There are only few minor excpetions rather unimportant for most of users unique to given RDDs. The most important are two:

1. I implemented dynamic unique indexes only in DBFCDX It means that ordUnique( ,, .t. ) -> can enable/disable unique mode only in DBFCDX (and SIXCDX)

2. Only in DBFNTX and DBFNSX I implement special mode which allows to use page numbers instead of file offsets in index pages. In this mode indexes are not binary compatible with other languages but their maximal size has been greatly extended and for NTX and NSX files is 2^32 * index_page_size what gives 2^42 for default 1024 pages in this formats – 2^42 is 4TB I haven’t implemented it in DBFCDX so far and for this format maximum index size is still 4GB. Maybe in some spare time I’ll do that and also add support for different page sizes. BTW in ADS .adi indexes are slightly modified CDX files where page numbers are used instead of offsets and index page size can be changed.

Of course there are very serious differences in low level implementation and structures used by these formats.

NTX is simple BTREE without any compression. The operation are extremely fast but indexes are much bigger then in CDX or NSX format so performance is usually storngly reduced by cost of IO operations. Anyhow theoretically having very strong server application with a lot of RAM so all data are accessed from memory not from harddisks this is the best choice.

CDX and NSX compress leaf nodes so total size of index files is much smaller then in NTX format. NSX uses simple BTREE when CDX uses three of the most significant keys. It means that update in CDX files can be more expensive then in NSX format especially if we are adding keys which should be sorted as last (it’s the most common situation, i.e. when we are adding records with current date) because all nodes from leaf to root have to be updated. All keys are repeated in leaf nodes and there are internal bindings for nodes on the same level (BTW some RDDs like SIX3 do not update them correctly for interior nodes) so CDX format is also a little bit redundant. Anyhow all keys are repeated in leafs nodes and we have internal bindings between all leaves so skipping can be a little bit faster, etc.

Page size in CDX is smaller then in NSX so for very long keys, i.e. over 100 bytes NSX format should be much more efficient. It also uses different compression method which should be better for keys having long space substrings inside, i.e. due to concatenation of few longer fields like: FNAME[40] + LNAME[40]

In general this is to big subject to describe it here in few words.

In include/hbrddnsx.h I’ve made some small description of NSX format when I was implementing it.

best regards,
Przemek
Source : https://groups.google.com/d/msg/harbour-devel/9nT9lZmtztk/Q3X-s81UpYYJ

Harbour All Commands

All

? | ?? Display one or more values to the console
@…BOX Draw a box on the screen
@…CLEAR Clear a rectangular region of the screen
@…GET Build a new Get object and display it to the screen
@…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
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 STRUCTURE EXTENDED 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
DO* Executes a function or procedure
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 Build an index file
INPUT Enter the result of an expression into a variable
JOIN Build 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 an OS 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 AUTOPEN Toggles automatic opening of a structural index file
SET AUTORDER Defines the default controlling index for automatically opened index files
SET AUTOSHARE Defines network detection for shared file access
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 application 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 MBLOCKSIZE Change the block size for memo files
SET MESSAGE Set the @…PROMPT message line row
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 STRICTREAD Toggles read optimization for database access
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