Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - <b>dfpknew()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dfPkNew()
Create a new primary/unique key
------------------------------------------------------------------------------
Syntax:

     dfPkNew( @<iKeyVar>|<bKeyVar>, <nFileOrde>,;
          <cKeyName>, <aKeyStru>, [<nInc>] ) --> lSuccess

Parameters:

     <iKeyVar>|<bKeyVar> Variable containing new key value, iKeyVar
              is passed by reference. If you use <bKeyVar> 
     the var isn't passed by reference
     <nFileOrder> Index order to use when computing new value
     <cKeyName> Primary key name.
     <aKeyStru> Primary key structure
     <nInc>     Key increment step. Default: 1

Returns:

     <lSuccess> If .T., the key has been successfully computed.

Description:

     This function creates new primary/unique keys. The keys can be
     composite (more fields). The system will create a new key incrementing
     the indicated field with the value indicated as increment step.

Example:

     GO BOTTOM
     ? InvH->( InvCod )          // Ex: "00123"
     InvH->(dfPkNew( @InvCod, 1, "InvCod",;
                     oWin:W_PRIMARYKEY, 2 ))
     ? InvH->( InvCod )          // Re: "00125"

See also:

     ddPkChk()

See Also: ddPkChk()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson