| re: problem with mid() function
Evertjan. wrote on 14 nov 2003 in
microsoft.public.inetserver.asp.general:
[color=blue]
> Joeandtel wrote on 14 nov 2003 in
> microsoft.public.inetserver.asp.general:
>[color=green]
>> 'When I create a single character string
>> var str = "A"[/color][/color]
var is j(ava)script, not vbscript
[color=blue][color=green]
>> 'convert to ascii
>> num = asc(str)
>> Response.Write num ' 65 shows up[/color][/color]
num is undefined
[color=blue][color=green]
>> 'when I have a whole string
>> str = "hello"
>> str = mid(str, 1, 1) ' return 'h'
>> num = asc(str)
>> 'I get an error:
>> Invalid procedure call or argument: 'asc'
>> What can be done to fix this?
>>[/color]
>
> <%
>
> response.write asc("h") &"<br>"
> response.write asc("hello") &"<br>"
>
> str="hello"
> response.write asc(str) &"<br>"
> s=mid(str,1,1)[/color]
str=mid(str,1,1) ' I mean
[color=blue]
> response.write asc(str) &"<br>"
>
> response.write asc(mid("hello",1,1)) &"<br>"
>
> %>
>
> gives:
>
> 104
> 104
> 104
> 104
> 104
>
> no error to be seen.
>[/color]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress) |