They are platform/situation-dependent:
http://msdn.microsoft.com/library/de...scriptinga.asp
I posted that suggestion without testing, assuming it would be the
answer. It turns out I was wrong. According to this test:
<%
dim s, i, ar
ar=array(vbNewLine, vbCrLf)
for each s in ar
Response.Write "Next constant:<BR>"
for i = 1 to len(s)
Response.Write Asc(mid(s,i,1)) & "<BR>"
next
next
%>
The two constants would seem to be equivalent in this situation. So, I
would suggest looping through your string (similar to the above) and
discover what actually is being passed in the form submission for line
break characters.
In fact, based on this test:
<%
if Request.Form.Count>0 then
dim s, i
s=Request.Form("txt")
for i = 1 to len(s)
Response.Write Asc(mid(s,i,1)) & "<BR>"
next
Response.Write "Instr(s,vbCrLf & vbCrLf): " & Instr(s,vbCrLf & vbCrLf)
& "<BR>"
Response.Write "Instr(s,vbNewLine & vbNewLine): " & Instr(s,vbNewLine &
vbNewLine) & "<BR>"
end if
%>
<HTML>
<BODY>
<FORM action="" method=POST id=form1 name=form1>
<textarea name=txt></textarea>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</FORM>
</BODY>
</HTML>
Both constants seem to work when I enter a<enter><enter>a in the text
area and submit it.
SLH wrote:
thank you ill try that now. question, what is the actual difference
between vbNewLine and vbCrLf?
i ask because i do some other things on various pages using vbNewLine
and im wondering if there is good reason to change it to vbCrLf
thanks
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:Op**************@TK2MSFTNGP04.phx.gbl...
>SLH wrote:
>>if i have a text area on a page that i want to validate, and i dont
want there to ever be 2 "enter"s in a row, how can i check for this?
ive been playing with something like:
If InStr(string, "vbnewline&vbnewline") <0
but i cant get that to work no matter what i do with the quotes etc.
but thats the general idea of what i want to do.
any ideas?
vbCrLf & vbCrLf
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.