Using application variables, arrays

Results 1 to 3 of 3

Thread: Using application variables, arrays

  1. #1
    Join Date
    Dec 1969

    Default Using application variables, arrays

    I have used this same code structure for a few tables/arrays. It is working in 3 cases but not this one. The code is below:<BR>In Global.asa I have:<BR>dim rsforce<BR>set rsforce = createobject("adodb.recordset")<BR>strSQL = "select force_type_cd, force_desc from ForcibleStop "<BR>set rsforce = connection1.Execute(strSQL) <BR>application("force") = rsforce.GetRows <BR><BR>In the asp page that will display, I have:<BR>dim forciblestop<BR>dim i<BR>forciblestop = application("force")<BR>i=0<BR>for i = 0 to UBound(forciblestop,2) <BR> if forcetype = forciblestop(0,i) then <BR> forcedesc = forciblestop(1,i)<BR> end if<BR>next<BR><BR>In the HTML I display &#060;%=forcedesc%&#062;.<BR>Nothing displays, though when I do a response.write on forcetype, the value is there.<BR>Anyone see what&#039;s wrong?<BR>Thanks,sandy

  2. #2
    Steve Cimino Guest

    Default RE: Using application variables, arrays

    We won&#039;t even get into the bad, bad thing of creating your object in the asa.. that will be for another post ;)<BR><BR>Do this:<BR><BR>Response.Write forcetype<BR>Response.Write forciblestop(0,0)<BR><BR>Your if statement if returning false... keep in mind that if these are strings, there is a case sensitivity involved. If they are numbers, you may be trying to compare a string to a number.<BR><BR>Impossible to tell since you don&#039;t show us what forcetype contains.<BR><BR>Incidentally, this is redundant code:<BR>i=0<BR>for i = 0 to UBound(forciblestop,2) <BR><BR>You&#039;re already intializiing i to 0 in your FOR loop.

  3. #3
    Join Date
    Dec 1969

    Default Thank you

    I thought it was comparing integer to integer, but it wasn&#039;t. I had to add forcetype = cint(forcetype).<BR>Thanks,<BR>sandy

Posting Permissions

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