NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorReece
    • CommentTimeSep 22nd 2013
     
    I have code which is, in essence, this...

    //----------- code

    cDatabase = "BUYERS"

    sel_num := select ( cDatabase )

    IF sel_num > 0
    CLOSE (cDatabase)
    ENDIF

    USE ( cDatabase ) SHARED NEW
    //----------- code ends

    If the BUYERS table is open, sel_num should be above zero. But it seems to be zero when I display the value. Why is this? I cannot find select in the xH help file. Why?
    •  
      CommentAuthorxbasefan
    • CommentTimeSep 23rd 2013
     
    have a look to the "xHarbour Language Reference Guide.chm" which is in your /xharbour/doc directory.
    wilson

    // ----------------- excerpt
    Select()
    Retrieves the work area number by alias name.

    Syntax
    Select( [<cAlias>] ) --> nWorkArea

    Arguments
    <cAlias>
    A character string holding the alias name of the work area to select as current.

    Return
    The function returns an integer numeric value representing the work area number of the work area having the alias name <cAlias>. If this alias does not exist, the return value is zero. When <cAlias> is omitted, the function returns the work area number of the current work area.

    Description
    Select() retrieves the work area number by its alias name. This is the opposite of function Alias(), which retrieves the alias name of a work area by its number.
    Work areas are numbered from 1 to 65535. They hold open database and index files and make them accesible to database functions and commands.

    Info
    See also: Alias(), DbSelectArea(), FieldGet(), SELECT, USE, Used()
    Category: Database functions
    Source: rdd\dbcmd.c
    LIB: xhb.lib
    DLL: xhbdll.dll

     
    Example
    // The example opens two databases in two different work areas
    // shows their work area numbers.
    
       PROCEDURE Main
          USE Customer ALIAS Cust
    
          DbSelectArea(10)
          USE Invoice ALIAS Inv
    
          ? Select()                       // result: 10
          ? Select( "Cust" )               // result:  1
          ? Select( "Inv" )                // result: 10
    
          CLOSE ALL
       RETURN
    

    // ----------------- end excerpt
    •  
      CommentAuthorReece
    • CommentTimeSep 24th 2013
     
    Hi xbasefan

    Thanks for the response. My point is it is not doing what the CHM file says and what worked in Clipper.
Add your comments
  • Format comments as