Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>sx_taginfo():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_TagInfo():

  Syntax:  Sx_TagInfo( [cIndexFileName] )

            cIndexFileName  = Name of Index file (order bag)

  Returns:   <array> Multi-dimensional array containing information about
             each tag in the compound (.CDX/.NSX) index file;  If the order
             is invalid or no index open, an empty array is returned.

  Description:    This function returns an array of six element arrays, each
                  containing information about a tag within the current or
                  specified compound index file.  If nOrder is not specified
                  then the current index is used.

                  The following information is returned for each tag:

                      [1] = Tag name
                      [2] = Index expression
                      [3] = Filter expression (or "" if no filter)
                      [4] = Logical value - .T. if index is UNIQUE
                      [5] = Logical value - .T. if index is in DESCENDING
                              order
                      [6] = Logical value - .T. if index is a RYO (Roll-
                            Your-Own) index (created using the EMPTY clause)

                  This function can also be used with .IDX files, and will
                  return a single element array containing an array with the
                  above information.  The index name is given in place of
                  the tag name.

    NOTE:  This function is NOT supported under SIXNTX.

  Example:

    //  This program displays information for all the tags in a compound
    //  (.NSX) index file.

    #include "SIXNSX.CH"
    #include "INKEY.CH"

    LOCAL nTagCnt                // Number of tags
    LOCAL aTagInfo               // Array to hold tag info
    LOCAL nCnt                   // Counter variable
    LOCAL nKey                   // User keystroke

    CLS                          // Clear the screen

    USE TEST VIA "SIXNSX"        // Open TEST.DBF

    INDEX ON LAST  TAG LAST      // Create LAST tag
    INDEX ON STATE TAG STATE     // Create STATE tag
    INDEX ON AGE   TAG AGE       // Create AGE tag

    nTagCnt  := Sx_TagCount()    // Get number of tag for current .NSX

    aTagInfo := Sx_TagInfo()     // Get the tag info for current .NSX

    // Now draw the display
    @  5,2 TO 15,77 DOUBLE
    @  5,35 SAY " Tag Info "
    @  6, 4 SAY "Index File.......:"
    @  6,23 SAY Sx_IndexName()           // Show the name of the index file
    @  6,40 SAY "Tags Available...:"
    @  6,59 SAY nTagCnt PICT "99"        // Show number of tags
    @  8, 4 SAY "Tag Name.........:"
    @  9, 4 SAY "Key Expression...:"
    @ 10, 4 SAY "Filter Expression:"
    @ 11, 4 SAY "Unique?..........:"
    @ 12, 4 SAY "Descending?......:"
    @ 13, 4 SAY "Roll-Your-Own?...:"
    @ 15,26 SAY " PgUp  PgDn     Esc to quit "

    nCnt := 1      // Start with first tag

    // Display tag info until user can't take it any more!
    DO WHILE (.T.)

      // Display the tag info
      @  8,23 SAY PadR( aTagInfo[ nCnt, 1 ], 8)
      @  9,23 SAY PadR( aTagInfo[ nCnt, 2 ], 52)
      @ 10,23 SAY PadR( aTagInfo[ nCnt, 3 ], 52)
      @ 11,23 SAY iif( aTagInfo[ nCnt, 4 ], "Yes", "No ")
      @ 12,23 SAY iif( aTagInfo[ nCnt, 5 ], "Yes", "No ")
      @ 13,23 SAY iif( aTagInfo[ nCnt, 6 ], "Yes", "No ")

      nKey := Inkey(0)

      DO CASE

        CASE nKey == K_PGDN        // Go to next one
          IF nCnt < nTagCnt
            nCnt++
          ENDIF

        CASE nKey == K_PGUP        // Go to previous one
          IF nCnt > 1
            nCnt--
          ENDIF

        CASE nKey == K_ESC         // Outta here!
          EXIT

        OTHERWISE                  // Bad key!
          Tone( 1000, 3 )

      ENDCASE

    ENDDO
    CLS


See Also: Sx_TagCount() OrdFor() OrdKey() OrdName() OrdNumber() Sx_Tags()

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