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>cxcgiival()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
cxCgiIVal()
Returns the name or value of a form object by index number
---------------------------------------------------------------------

Syntax:

  cxCgiIVal( <nObjectSubscript>, <nContentSubscript> )  --->  cString

Arguments: None

  <nObjectSubscript> is the numeric index to be used for the first
  subscript of the form object array. This is the index to the form objects
  as they were read by the web server.

  <nContentSubscript> is the numeric index to be used for the second
  subscript of the form object array. This vlue determines if the form
  object NAME or the form object VALUE is returned. A value of 1 returns
  the name of the object. A value of 2 returns the value of the object.

Returns:

  A character string containing the name or the value of the target
  form object.

Description:

  cxCgiIVal() returns either the name or the value of a form object.

  <nNameSubscript> is the index of the form object.

  <nValueSubscript> is the index for the name or value.

  If your form had two text objects on the form: eMail=me@xyz.com
  and state=TX:

  cxCgiIVal( 1, 1 ) --> eMail
  cxCgiIVal( 1, 2 ) --> me@xyz.com
  cxCgiIVal( 2, 1 ) --> state
  cxCgiIVal( 2, 2 ) --> TX

  You can also extract a form object value by supplying the object name.
  cxCgiValue() returns a value for a given name.
  Example: cxCgiValue( "state" ) --> TX

Examples:

  Example 1: Using cxCGIIVal() to print all form object names and values.

    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 2: 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: cxCgiCount() cxFormArray() cxCgiValue()

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