Request method

Results 1 to 2 of 2

Thread: Request method

  1. #1
    Join Date
    Dec 1969

    Default Request method

    Hi,<BR>I have a big problem here. When I use request, either request.querystring or request.form, the value I&#039m getting is actually a string (I use reponse.write to check), for eg: a name, but when I pass to an object which needs a string, it gives me "type mismatch" error. But If I use command CStr, then the error gone. Why?

  2. #2
    Joel N Guest

    Default RE: Request method

    VBScript is not stronly typed. ALL variables in VBScript are variants. (My understanding is that in Microsoft&#039s .NET initiative the C# language WILL be strongly typed but I&#039m not sure about that.) You can sub-type variants with conversion functions like CStr or CInt to pass them to procedures that need a particular data type but they are still variants.<BR><BR>Example:<BR><BR>Dim x<BR>Dim y<BR>x = "23"<BR>y = CInt(x)<BR><BR><BR>At this point you might think y is an integer, but it isn&#039t. You&#039ve simply stored an integer value in a variant variable. <BR><BR>HTH<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts