Combine ASP Strings

Results 1 to 2 of 2

Thread: Combine ASP Strings

  1. #1
    Join Date
    Dec 1969

    Default Combine ASP Strings

    I would like to combine the two response.write lines into a<BR>string. This is what I want to be the output.<BR> somestring="WHERE PID=1 OR PID=2 OR PID=3"<BR>The second response.write line can contain multiple values.<BR>Should I be using an array for this and how would I implement<BR>it. The code is as follows:<BR><BR>&#060;%If Request.Form(Item).Count &#062; 1 Then%&#062;<BR> Response.Write("WHERE PID=" & Request.Form(Item)(1))%&#062;<BR> &#060;%For Loop=2 to Request.Form(Item).Count%&#062;<BR> Response.Write(" OR PID=" & Request.Form(Item)(Loop))<BR> Next%&#062;<BR>&#060;%End If%&#062;<BR><BR>Thanks for the help.<BR><BR>KaL

  2. #2
    Join Date
    Dec 1969

    Default RE: Combine ASP Strings

    try this (if I understood you correctly):<BR>strTemp = ""<BR>&#060;%If Request.Form(Item).Count &#062; 1 Then<BR> strTemp = "WHERE PID=" & Request.Form(Item)(1)<BR> For Loop=2 to Request.Form(Item).Count<BR> strTemp = strTemp & " OR PID=" & Request.Form(Item)(Loop)<BR> Next<BR> End If%&#062;<BR>strTemp will include all what you need.<BR>By the way, you don&#039t have to embrace each row with &#060;%%&#062;

Posting Permissions

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