Files
harbour-core/harbour/doc/en/browse.txt
Viktor Szakats 45a114e471 2010-06-03 18:17 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* tests/testsha1.prg
  * tests/longdev.prg
  * tests/clsccast.prg
  * tests/cmphello.prg
  * tests/clsicast.prg
  * tests/testop.prg
  * tests/clsscast.prg
  * tests/objarr.prg
  * tests/rddtest/rddmktst.prg
  * tests/rddtest/adscl52.prg
  * tests/rddtest/adscl53.prg
  * tests/rddtest/ntxcl52.prg
  * tests/rddtest/ntxcl53.prg
  * tests/rddtest/cdxcl52.prg
  * tests/rddtest/rddtst.prg
  * tests/rddtest/cdxcl53.prg
  * tests/transtst.prg
  * tests/output.prg
  * tests/ac_test2.prg
  * tests/clsscope.prg
  * tests/dosshell.prg
  * tests/sbartest.prg
  * tests/speedold.prg
  * tests/sdf_test.prg
  * tests/wcecon.prg
  * tests/debugtst.prg
  * tests/testdyn.c
  * tests/multiarg.prg
  * tests/fornext.prg
  * tests/hbinline.prg
  * tests/foreach2.prg
  * tests/objasign.prg
  * tests/scroll.prg
  * tests/inherit.prg
  * tests/rto_get.prg
  * tests/boxtst2.prg
  * tests/inkeytst.prg
  * tests/overload.prg
  * tests/cpinfo.prg
  * tests/gtwin.prg
  * tests/mt/mttest08.prg
  * tests/mt/mttest09.prg
  * tests/mt/mttest01.prg
  * tests/mt/mttest10.prg
  * tests/mt/mttest02.prg
  * tests/mt/mttest11.prg
  * tests/mt/mttest03.prg
  * tests/mt/mttest12.prg
  * tests/mt/mttest04.prg
  * tests/mt/mttest05.prg
  * tests/mt/mttest06.prg
  * tests/mt/mttest07.prg
  * tests/speedtst.prg
  * tests/testsha2.prg
  * tests/hsxtest.prg
  * tests/arrayidx.prg
  * tests/clsnv.prg
  * tests/rto_tb.prg
  * tests/gtchars.prg
  * tests/disptest.prg
  * tests/funcarr.prg
  * tests/testhtml.prg
  * tests/readhrb.prg
  * tests/tstcolor.prg
  * tests/gtxfnt.prg
  * tests/devtest.prg
  * tests/aliaslck.prg
  * tests/stripem.prg
  * tests/dynobj.prg
  * tests/tb1.prg
  * tests/round.prg
  * tests/longstr.prg
  * tests/testdyn.prg
  * tests/testdyn1.prg
  * tests/delimtst.prg
  * tests/tstdspac.prg
  * tests/version.prg
  * tests/setkeys.prg
  * tests/gtcolors.prg
  * tests/destruct.prg
  * tests/seconds.prg
  * tests/gtkeys.prg
  * tests/usrrdd/exarr.prg
  * doc/en/diskspac.txt
  * doc/en/string.txt
  * doc/en/rdd.txt
  * doc/en/hashes.txt
  * doc/en/hb_apigt.txt
  * doc/en/rddord.txt
  * doc/en/hb_api.txt
  * doc/en/hb_date.txt
  * doc/en/math.txt
  * doc/en/hb_vm.txt
  * doc/en/treport.txt
  * doc/en/terminal.txt
  * doc/en/hb_apiln.txt
  * doc/en/dir.txt
  * doc/en/command.txt
  * doc/en/rddmisc.txt
  * doc/en/errsys.txt
  * doc/en/nation.txt
  * doc/en/var.txt
  * doc/en/dbstrux.txt
  * doc/en/datetime.txt
  * doc/en/memo.txt
  * doc/en/tgetlist.txt
  * doc/en/tlabel.txt
  * doc/en/1stread.txt
  * doc/en/hb_set.txt
  * doc/en/hb_compa.txt
  * doc/en/hb_apier.txt
  * doc/en/hbinet.txt
  * doc/en/hb_macro.txt
  * doc/en/array.txt
  * doc/en/hb_apiit.txt
  * doc/en/rdddb.txt
  * doc/en/dbsdf.txt
  * doc/en/hvm.txt
  * doc/en/input.txt
  * doc/en/dbdelim.txt
  * doc/en/browse.txt
  * doc/en/menu.txt
  * doc/en/hb_apird.txt
  * doc/en/hb_apifs.txt
  * doc/en/file.txt
  * doc/en/lang.txt
  * doc/en/objfunc.txt
  * doc/en/eval.txt
  * doc/en/binnum.txt
  * doc/en/tclass.txt
  * doc/en/misc.txt
  * doc/en/set.txt
  * doc/en/readme.txt
  * doc/man/harbour.1
  * doc/man/hbmk2.1
  * doc/man/hbpp.1
  * doc/man/hbtest.1
  * doc/man/hbrun.1
  * examples/hbextern/hbextern.prg
  * examples/pp/pp.c
  * examples/pp/hbpragma.c
  * examples/pp/hbppcore.c
  * examples/pp/hbppcomp.c
  * examples/pp/hbpptbl.c
  * examples/pp/hbppdef.h
  * examples/superlib/hbsuper.prg
  * examples/hbsqlit2/hbsqlit2.ch
  * examples/misc/mankala.prg
  * examples/misc/guess.prg
  * examples/rddado/adordd.prg
  * examples/rddado/adordd.ch
  * examples/hbapollo/apollo.ch
  * examples/hbapollo/apollo.c
  * examples/hbapollo/apollo1.prg
  * examples/hbdoc2/gentpl.prg
  * examples/hbdoc2/gentxt.prg
  * examples/hbdoc2/tmplates.prg
  * examples/hbdoc2/genxml.prg
  * examples/hbdoc2/genhtml.prg
  * examples/hbdoc2/hbdoc2.prg
  * examples/hbdoc2/hbdoc2.ch
  * examples/guestbk/guestbk.prg
  * examples/httpsrv/uhttpd.ini
  * examples/httpsrv/uhttpd.prg
  * examples/httpsrv/cookie.prg
  * examples/httpsrv/cgifunc.prg
  * examples/httpsrv/session.prg
  * examples/terminal/trm_cli.prg
  * examples/terminal/terminal.prg
  * examples/terminal/trm_srv.prg
  * examples/terminal/trm_app.prg
  * examples/hbbtree/hb_btree.h
  * examples/hbbtree/hb_btree.ch
  * examples/hbbtree/hb_btree.c
  * examples/hbbtree/tbtree.prg
  * examples/hscript/hscript.prg
  * examples/hscript/dir.hs
  * examples/hscript/multiply.hs
  * examples/hscript/ugly.hs
  * examples/hscript/hello.hs
  * examples/gtwvw/hbole.h
  * examples/gtwvw/wvwdraw.c
  * examples/gtwvw/wvwmenu.c
  * examples/gtwvw/gtwvw.c
  * examples/gtwvw/wvwstbar.c
  * examples/gtwvw/wvwcheck.c
  * examples/gtwvw/wvwfuncs.c
  * examples/gtwvw/wvwpush.c
  * examples/gtwvw/wvwedit.c
  * examples/gtwvw/wvwtbar.c
  * examples/gtwvw/hbgtwvw.h
    * Deleted 'www.' from harbour-project.org website name.
      (www.harbour-project.org -> harbour-project.org)
2010-06-03 16:23:36 +00:00

376 lines
14 KiB
Plaintext

/*
* $Id$
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://harbour-project.org
*
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
* Documentation for: BROWSE(), DBEDIT(), TBROWSEDB(), DBSKIPPER()
*
* See COPYING for licensing terms.
*
*/
/* TODO: put more comprehensive $EXAMPLES$.
DBEDIT() is a complex function, the doc I had made cover all the
parameters but probably not good enough for a new user that does
not know what this function is all about and how to use it. I am
not that good with the English language (and I did not want to
COPY the NG text) I suggest later some one should add to this
text. [chkedem] */
/* $DOC$
* $TEMPLATE$
* Function
* $NAME$
* DBEDIT()*
* $CATEGORY$
* API
* $SUBCATEGORY$
* User interface
* $ONELINER$
* Browse records in a table
* $SYNTAX$
* DBEDIT( [<nTop>], [<nLeft>], [<nBottom>], [<nRight>], [<acColumns>], [<xUserFunc>], [<xColumnSayPictures>], [<xColumnHeaders>], [<xHeadingSeparators>], [<xColumnSeparators>], [<xFootingSeparators>], [<xColumnFootings>] ) --> lOk
* $ARGUMENTS$
* <nTop> coordinate for top row display. <nTop> could range from 0
* to MAXROW(), default is 0.
*
* <nLeft> coordinate for left column display. <nLeft> could range
* from 0 to MAXCOL(), default is 0.
*
* <nBottom> coordinate for bottom row display. <nBottom> could range
* from 0 to MAXROW(), default is MAXROW().
*
* <nRight> coordinate for right column display. <nRight> could range
* from 0 to MAXCOL(), default is MAXCOL().
*
* <acColumns> is an array of character expressions that contain
* database fields names or expressions to display in each column.
* If not specified, the default is to display all fields from the
* database in the current work area.
*
* <xUserFunc> is a name of a user defined function or a code block
* that would be called every time unrecognized key is been pressed or
* when there are no keys waiting to be processed and DBEDIT() goes
* into idle mode. If <xUserFunc> is a character string, it must
* contain root name of a valid user define function without
* parentheses. Both the user define function or the code block should
* accept two parameters: nMode, nCurrentColumn. Both should return
* a numeric value that correspond to one of the expected return codes
* (see table below for a list of nMode and return codes).
*
* <xColumnSayPictures> is an optional picture. If <xColumnSayPictures>
* is a character string, all columns would used this value as a
* picture string. If <xColumnSayPictures> is an array, each element
* should be a character string that correspond to a picture string
* for the column with the same index. Look at the help for @...SAY
* to get more information about picture values.
*
* <xColumnHeaders> contain the header titles for each column, if this
* is a character string, all columns would have that same header, if
* this is an array, each element is a character string that contain
* the header title for one column. Header may be split to more than
* one line by placing semicolon (;) in places where you want to break
* line. If omitted, the default value for each column header is taken
* from <acColumns> or field name if <acColumns> was not specified.
*
* <xHeadingSeparators> is an array that contain characters that draw
* the lines separating the headers and the fields data. Instead of an
* array you can use a character string that would be used to display
* the same line for all fields. Default value is a double line.
*
* <xColumnSeparators> is an array that contain characters that draw
* the lines separating displayed columns. Instead of an array you can
* use a character string that would be used to display the same line
* for all fields. Default value is a single line.
*
* <xFootingSeparators> is an array that contain characters that draw
* the lines separating the fields data area and the footing area.
* Instead of an array you can use a character string that would be
* used to display the same line for all footers. Default is to have to
* no footing separators.
*
* <xColumnFootings> contain the footing to be displayed at the bottom
* of each column, if this is a character string, all columns would
* have that same footer, if this is an array, each element is a
* character string that contain the footer for one column. Footer may
* be split to more than one line by placing semicolon (;) in places
* where you want to break line. If omitted, no footer are displayed.
* $RETURNS$
* DBEDIT() return .F. if there is no database in use or if the number
* of columns to display is zero, else DBEDIT() return .T.
* $DESCRIPTION$
* DBEDIT() display and edit records from one or more work areas in
* a grid on screen. Each column is defined by element from <acColumns>
* and is the equivalent of one field. Each row is equivalent of one
* database record.
*
* Following are active keys that handled by DBEDIT(): </par>
* ---------------------------------------------------
*
* <table>
* Key Meaning
*
* Left Move one column to the left (previous field)
* Right Move one column to the right (next field)
* Up Move up one row (previous record)
* Down Move down one row (next record)
* Page-Up Move to the previous screen
* Page-Down Move to the next screen
* Ctrl Page-Up Move to the top of the file
* Ctrl Page-Down Move to the end of the file
* Home Move to the leftmost visible column
* End Move to the rightmost visible column
* Ctrl Left Pan one column to the left
* Ctrl Right Pan one column to the right
* Ctrl Home Move to the leftmost column
* Ctrl End Move to the rightmost column
* </table>
*
* When <xUserFunc> is omitted, two more keys are active:
*
* <table>
* Key Meaning
*
* Esc Terminate BROWSE()
* Enter Terminate BROWSE()
* </table>
*
* When DBEDIT() execute <xUserFunc> it pass the following arguments:
* nMode and the index of current record in <acColumns>. If <acColumns>
* is omitted, the index number is the FIELD() number of the open
* database structure.
*
* DBEDIT() nMode could be one of the following: </par>
* ---------------------------------------------
*
* <table>
* Dbedit.ch Meaning
*
* DE_IDLE DBEDIT() is idle, all movement keys have been handled.
* DE_HITTOP Attempt to cursor past top of file.
* DE_HITBOTTOM Attempt to cursor past bottom of file.
* DE_EMPTY No records in work area, database is empty.
* DE_EXCEPT Key exception.
* </table>
*
* The user define function or code block must return a value that tell
* DBEDIT() what to do next.
*
* User function return codes: </par>
* --------------------------- </par>
*
* <table>
* Dbedit.ch Value Meaning
*
* DE_ABORT 0 Abort DBEDIT().
* DE_CONT 1 Continue DBEDIT() as is.
* DE_REFRESH 2 Force reread/redisplay of all data rows.
* </table>
*
* The user function is called once in each of the following cases:
* - The database is empty.
* - The user try to move past top of file or past bottom file.
* - Key exception, the uses had pressed a key that is not handled by DBEDIT().
* - The keyboard buffer is empty or a screen refresh had just occurred
* DBEDIT() is a compatibility function, it is superseded by the
* TBrowse class and there for not recommended for new applications.
* $EXAMPLES$
* // Browse a file using default values
* USE Test
* DBEDIT()
* $STATUS$
* S
* $COMPLIANCE$
* <xUserFunc> can take a code block value, this is a Harbour
* extension.
*
* CA-Cl*pper will throw an error if there's no database open, Harbour
* would return .F.
*
* CA-Cl*pper is buggy and will throw an error if the number of columns
* is zero, Harbour would return .F.
*
* The CA-Cl*pper 5.2 NG state that the return value is NIL, this is
* wrong and should be read logical.
*
* There is an undocumented result code (3) from the user defined
* function in CA-Cl*pper (both 87 and 5.x). This is an Append Mode which:
* "split the screen to allow data to be appended in windowed area".
* This mode is not supported by Harbour.
* $FILES$
* Header files are dbedit.ch, inkey.ch
* Library is rtl
* $SEEALSO$
* @...SAY,BROWSE(),TBrowse class,TRANSFORM()
* $END$
*/
/* $DOC$
* $TEMPLATE$
* Function
* $NAME$
* BROWSE()
* $CATEGORY$
* API
* $SUBCATEGORY$
* User interface
* $ONELINER$
* Browse a database file
* $SYNTAX$
* BROWSE( [<nTop>, <nLeft>, <nBottom>, <nRight>] ) --> lOk
* $ARGUMENTS$
* <nTop> coordinate for top row display.
*
* <nLeft> coordinate for left column display.
*
* <nBottom> coordinate for bottom row display.
*
* <nRight> coordinate for right column display.
* $RETURNS$
* BROWSE() return .F. if there is no database open in this work area,
* else it return .T.
* $DESCRIPTION$
* BROWSE() is a general purpose database browser, without any
* thinking you can browse a file using the following keys:
*
* <table>
* Key Meaning
*
* Left Move one column to the left (previous field)
* Right Move one column to the right (next field)
* Up Move up one row (previous record)
* Down Move down one row (next record)
* Page-Up Move to the previous screen
* Page-Down Move to the next screen
* Ctrl Page-Up Move to the top of the file
* Ctrl Page-Down Move to the end of the file
* Home Move to the leftmost visible column
* End Move to the rightmost visible column
* Ctrl Left Pan one column to the left
* Ctrl Right Pan one column to the right
* Ctrl Home Move to the leftmost column
* Ctrl End Move to the rightmost column
* Esc Terminate BROWSE()
* </table>
*
* On top of the screen you see a status line with the following
* indication:
*
* <table>
* Record ###/### Current record number / Total number of records.
* <none> There are no records, the file is empty.
* <new> You are in append mode at the bottom of file.
* <Deleted> Current record is deleted.
* <bof> You are at the top of file.
* </table>
*
* You should pass whole four valid coordinate, if less than four
* parameters are passed to BROWSE() the coordinate are default to:
* 1, 0, MAXROW(), MAXCOL().
* $EXAMPLES$
* // this one shows you how to browse around
* USE Around
* BROWSE()
* $STATUS$
* S
* $COMPLIANCE$
* C
* $FILES$
* Library is rtl
* $SEEALSO$
* DBEDIT()*,TBrowse class
* $END$
*/
/* $DOC$
* $TEMPLATE$
* Function
* $NAME$
* TBrowseDB()
* $CATEGORY$
* API
* $SUBCATEGORY$
* User interface
* $ONELINER$
* Create a new TBrowse object to be used with database file
* $SYNTAX$
* TBrowseDB( [<nTop>], [<nLeft>], [<nBottom>], [<nRight>] ) --> oBrowse
* $ARGUMENTS$
* <nTop> coordinate for top row display.
*
* <nLeft> coordinate for left column display.
*
* <nBottom> coordinate for bottom row display.
*
* <nRight> coordinate for right column display.
* $RETURNS$
* TBrowseDB() return new TBrowse object with the specified coordinate
* and a default :SkipBlock, :GoTopBlock and :GoBottomBlock to browse
* a database file.
* $DESCRIPTION$
* TBrowseDB() is a quick way to create a TBrowse object along with
* the minimal support needed to browse a database. Note that the
* returned TBrowse object contain no TBColumn objects and you need
* to add column for each field by your self.
* $EXAMPLES$
* for a good example, look at the source code for BROWSE() function
* at src/rtl/browse.prg
* $STATUS$
* S
* $COMPLIANCE$
* H
* $FILES$
* Library is rtl
* $SEEALSO$
* BROWSE(),TBColumn class,TBrowse class,TBrowseNew()
* $END$
*/
/* $DOC$
* $TEMPLATE$
* Function
* $NAME$
* dbSkipper()
* $CATEGORY$
* API
* $SUBCATEGORY$
* User interface
* $ONELINER$
* Helper function to skip a database
* $SYNTAX$
* dbSkipper( <nRecs> ) --> nSkipped
* $ARGUMENTS$
* <nRecs> is the number of records to skip relative to current record.
* Positive number would try to move the record pointer forward, while
* a negative number would try to move the record pointer back <nRecs>
* records.
* $RETURNS$
* dbSkipper() return the number of actual record skipped.
* $DESCRIPTION$
* dbSkipper() is a helper function used in browse mechanism to skip
* a number of records while giving the caller indication about the
* actual records skipped.
* $EXAMPLES$
* // open a file and find if we've got enough records in it
* USE MonthSales
* IF dbSkipper( 100 ) == 100
* ? "Good work! You can party now"
* ELSE
* ? "Too bad, you should really work harder"
* ENDIF
* CLOSE
* $STATUS$
* R
* $COMPLIANCE$
* XPP
* $FILES$
* Library is rtl
* $SEEALSO$
* DBSKIP(),SKIP
* $END$
*/