1. yls Guest

## sadf, -1, -1, -1, -1

hi, i just want the value of sadf only. please note that sadf can by in any of the -1 places.<BR>for example -1, -1, -1, sadf, -1

2. Senior Member
Join Date
Dec 1969
Posts
487

## RE: sadf, -1, -1, -1, -1

heh...<BR><BR>This would be 1 way:<BR><BR>Dim sadf<BR>Dim strLong<BR>Dim arrString<BR>Dim i<BR><BR>sadf = "What the..."<BR><BR>strLong = "-1, -1," & sadf & ", -1"<BR><BR>arrString = Split(strLong, ",")<BR><BR>For i = LBound(arrString) To UBound(arrString)<BR><BR> If Trim(arrString(i)) &#060;&#062; "-1" Then<BR> <BR> Response.Write arrString(i)<BR> <BR> End If<BR><BR>Next<BR><BR><BR>HTH<BR><BR>Darren<BR>[ darren@showusyourcode.com ]

3. Senior Member
Join Date
Dec 1969
Posts
96,118

## RE: sadf, -1, -1, -1, -1

Do you mean that you don&#039t know what "sadf" is but you know it isn&#039t -1? If so:<BR><BR>&#060;%<BR>val = "frammitz, -1, -1, -1, -1" &#039 or some other variation.<BR>...<BR>values = Split( val, "," )<BR>result = "" &#039 assume no result found!<BR>For i = 0 To UBound( values )<BR>&nbsp; &nbsp; If Not isNumeric(values(i)) Then<BR>&nbsp; &nbsp; &nbsp; &nbsp; result = values(i)<BR>&nbsp; &nbsp; &nbsp; &nbsp; Exit For<BR>&nbsp; &nbsp; End If<BR>&nbsp; &nbsp; &#039 might be numeric but *still* not -1!<BR>&nbsp; &nbsp; If CDbl(values(i)) &#060;&#062; -1 Then<BR>&nbsp; &nbsp; &nbsp; &nbsp; result = values(i)<BR>&nbsp; &nbsp; &nbsp; &nbsp; Exit For<BR>&nbsp; &nbsp; End If<BR>Next<BR><BR>&#039 when you get here, if any NON -1 item was found, it is in "result" variable<BR>...<BR>%&#062;<BR><BR>

4. Senior Member
Join Date
Dec 1969
Posts
487

## frammitz ???

Apart from the use of frammitz, how does your (longer) method differ from mine?<BR><BR>Darren

5. Senior Member
Join Date
Dec 1969
Posts
96,118

## RE: frammitz ???

Well, I guess I&#039m being a bit anal retentive, but I was thinking of -1.0 as being equivalent to -1 when treated as a number but not when treated as a string.<BR><BR>And I didn&#039t see your answer becuz I had started posting, got sidetracked by my wife, and came back...by which time you had posted.<BR><BR>

#### Posting Permissions

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