Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change delimiters in a variable

Status
Not open for further replies.

lynque

IS-IT--Management
Sep 30, 2004
124
CA
Hello All,

I have some some variables that can hold one or more pieces of data depending on what the user orders.
I would like to be able to insert the data in individual rows (with the same orderID) if there is more than one item in these variables.

The values are currently seperated by commas, the first step I think is to change the delimiter to another more obscure character.

Any tips or links you might suggest?
 
If you are using VBScript on your ASP pages, you can use the Split() function to break a string into an array.

Then you can use a For/Next Loop to insert each array element in turn.
 
try this function

function fixedarray(strText,strcharacter)
dim item
for each item in strText
temp = temp&item&strcharacter
next
temp=left(temp,len(temp)-1)
fixedarray=temp
end function

ex.

fixedarray(strvariable,"~")

 
i use it when when calling a request("somefield") that is repeat

ex.

strscores=fixedarray(request("scores"),"~")

the output of strscores would be: 95~90~65~80
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top