Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipX.Lib v1.2 - <b>cxcgicount()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
cxCgiCount()
Returns the element count of the form array
---------------------------------------------------------------------

Syntax:

  cxCgiCount()  --->  nElementCount

Arguments: None

Returns:

  The element count of the hidden array created by ClipXOpen().

Description:

  cxCgiCount() returns the element count of the array created by
  ClipXOpen(). The array contains the form data passed by the web server.
  The two-dimensional array contains the form object name in subscript one
  and the form object value in subscript two.

  The value returned from cxCgiCount can be used to transverse the
  array in a FOR loop. You can use cxCgiIVal() to obtain the form object
  value by array index number. See the example 1 below.

  If you prefer, you can make your own copy of the form object array by
  using cxFormArray(). See example 2 below.

Examples:

  Example 1: Using cxCgiCount() with the hidden form array

    function main()
      Local i := 0

      if !ClipXOpen()
        Quit
      endif
      header()

      Br() ; Br()
      htmlWrite( "There are " + Ltrim( Str( cxCgiCount() ) ) + " form objects.")
      Br()  ; Br()
      TableBeg()
      THbeg() ; htmlWrite(  "Form object name " )  ; THend()
      THbeg() ; htmlWrite( "Form object value " )  ; THend()
      for i := 1 to cxCgiCount()
        TRbeg()
        TDbeg() ; htmlWrite( cxCgiIVal( i, 1 ) )    ; TDend()
        TDbeg() ; htmlWrite( cxCgiIVal( i, 2 ) )    ; TDend()
        TRend()
      next
      TableEnd()

      ClipXClose()

    return nil


  Example 1: Same as example 1, but using your own copy of the form array

    function main()
      Local i := 0
      Local aX := {}

      if !ClipXOpen()
        Quit
      endif
      header()

      aX := cxFormArray()

      Br() ; Br()
      htmlWrite( "There are " + Ltrim( Str( Len( aX ) ) ) + " form objects.")
      Br()  ; Br()

      TableBeg()
      THbeg() ; htmlWrite(  "Form object name " )  ; THend()
      THbeg() ; htmlWrite( "Form object value " )  ; THend()
      for i := 1 to Len( zX )
        TRbeg()
        TDbeg() ; htmlWrite( aX[i][1] )  ; TDend()
        TDbeg() ; htmlWrite( aX[i][2] )  ; TDend()
        TRend()
      next
      TableEnd()

      ClipXClose()

    return nil

Files: Library is ClipX.Lib


See Also: cxCgiIVal() cxFormArray() cxCgiValue()

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