(newb) what's wrong with this?

Results 1 to 2 of 2

Thread: (newb) what's wrong with this?

  1. #1
    Join Date
    Dec 1969

    Default (newb) what's wrong with this?

    yes, I&#039;m brand new to this and trying to learn.<BR><BR>I have a simple excersise, I&#039;m trying to break fields out of a comma-delimited string of text.<BR><BR><BR>&#060;%<BR> strText = "Doe,John,101 Main St.,Las Vegas,Nevada,10133,www.LasVegas.com"<BR> i=0<BR> DIM Token_Array(6)<BR> <BR> for intLoop = 0 to 6<BR> <BR> strTemp = strText<BR> intEndOfField = Instr(strTemp, ",")<BR> Response.Write i & "-" & intEndOfFiled & "-" & len(strTemp) <BR>Token_Array(i) = mid(strTemp, 1, intEndOfField -1)<BR> strText = mid(strTemp, intEndOfField +1, len(strText))<BR> <BR> <BR> i = i +1<BR> next<BR><BR>I put on the line to display the length of text as it loops, so that seems to be working, but my array is not being populated - I get a "Invalid procedure call or argument: &#039;mid&#039; " on the line "Token_Array(i) = mid(strTemp, 1, intEndOfField -1)"<BR><BR>I&#039;m sure this is very simple, but I&#039;m feeling rather frustrated right now so if someone could help... <BR>

  2. #2
    Join Date
    Dec 1969

    Default use split

    yourArray= split(strText,",")

Posting Permissions

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