Check ASP Array through VBScript

Results 1 to 3 of 3

Thread: Check ASP Array through VBScript

  1. #1
    Join Date
    Dec 1969

    Default Check ASP Array through VBScript

    I have an array called pUsers that&#039;s created through ASP on page loadup. The problem is, later on in the code, I need to find out if it&#039;s empty or not.<BR><BR>I have this VBScript code:<BR>&#060;SCRIPT language="VBScript"&#062;<BR>&#060;!-- Begin<BR> function CAL(tmpArray) As Integer &#039;CAL = Check Array Length {<BR> On Local Error GoTo ErE<BR> CAL = UBound(tmpArray)<BR> <BR> ErE:<BR> CAL = 0<BR> }<BR>// End --&#062;<BR>&#060;/SCRIPT&#062;<BR><BR>and i&#039;m calling it through:<BR>&#060;% If CAL(pUsers) &#062; 0 Then %&#062;<BR><BR>But I get a type mismatch error.<BR>Any ideas as why this is happening?<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default You can't dim like that

    in VBScript.... you can&#039;t tell it a data type, nor can you use GoTo. Also, it looks like you&#039;re mixing server and client side code.

  3. #3
    Join Date
    Dec 1969

    Default In other words...

    ...NOT advanced. Right?<BR><BR>Better to ask beginning questions like this in the ASP Q&A forum.<BR><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