Results 1 to 2 of 2

Thread: array issue

  1. #1
    Join Date
    Dec 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default array issue

    Thanks in advance for your help!!!

    My issue is checking a array variable in a if statement to see if it empty.

    Like

    if pram(2) = "" then
    if empty redirect
    else
    not empty run code
    end if

    This is how my array is created

    strString=Request.ServerVariables("HTTP_X_ORIGINAL _URL")
    strArray = split(strString, "/")
    Redim pram(uBound(strArray))
    For i = 0 to uBound(strArray)
    pram(i) = strArray(i)
    Next


    I can get empty array by

    if uBound(strArray) = -1 then

    But I want to check the second item in the array if it's empty. The first item in the array will exist but the second item may not exist and then I need the to redirect the user accordingly.

  2. #2
    Join Date
    Apr 2016
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You could try the isEmpty function, but I have heard mixed reviews on it's effectiveness.
    Code:
    If isEmpty(myArray)
       Response.Write "It's as empty as empty could be"
    Else
       Response.Write "This glass is half full"
    End If

Similar Threads

  1. Replies: 3
    Last Post: 03-01-2012, 04:42 PM
  2. Resolved Please help! For loop and Explode($array) issue
    By olliepop in forum PHP
    Replies: 1
    Last Post: 10-06-2010, 11:16 AM
  3. Array Issue
    By thesprucegoose in forum JavaScript
    Replies: 1
    Last Post: 03-12-2009, 10:55 PM
  4. Array issue with MySQL. I'm about to die
    By janniesekind in forum PHP
    Replies: 0
    Last Post: 02-04-2009, 11:50 PM
  5. Replies: 5
    Last Post: 08-20-2007, 04:02 AM

Bookmarks

Posting Permissions

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