For Programmers: Free Programming Magazines  


Home > Archive > ASP > December 2006 > What's in a name? was: Re: Dim









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author What's in a name? was: Re: Dim
Evertjan.

2006-12-11, 6:57 pm

Mike Brind wrote on 07 dec 2006 in
microsoft.public.inetserver.asp.general:

> "name" is a reserved word in VBScript.
> That's why the interpreter is complaining.


Are you sure, Mike?

<%
dim name
name = "a"
response.write name
%>

Look, no errors!

<%
option explicit
dim name
name = "a"
response.write name
%>

Look, no errors!

> Dim lastname : lastname = Request.QueryString("name")


Last but not least,
a name by any other name smels just as sweet.
[color=darkred]

The root of the problem is in the quoting.

[and the () are also unneccessary]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mike Brind

2006-12-11, 6:57 pm


"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns989263BD2962Eeejj99@194.109.133.242...
> Mike Brind wrote on 07 dec 2006 in
> microsoft.public.inetserver.asp.general:
>
>
> Are you sure, Mike?
>


Well, I was, but....

Interesting. It's not in the list
(http://support.microsoft.com/default.aspx/kb/216528), yet my editor
(Dreamweaver) highlights it as a "Native Keyword for VBScript" (and JScript,
for that matter).

On further inspection, it seems that Dreamweaver makes no distinction
between VBScript/JScript reserved words and ADO methods and properties in
terms of its helpful code colouring.

As a prodigious user of Access in the past, I was always aware that Name is
a reserved word there, and generally avoid using it anywhere like the
plague. Just seeing the word in the OP caused bit of a knee-jerk reaction
:-)


Anthony Jones

2006-12-11, 6:57 pm


"Mike Brind" <discussions@microsoft.com> wrote in message
news:u%236pYPeGHHA.1912@TK2MSFTNGP03.phx.gbl...
>
> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> news:Xns989263BD2962Eeejj99@194.109.133.242...
>
> Well, I was, but....
>
> Interesting. It's not in the list
> (http://support.microsoft.com/default.aspx/kb/216528), yet my editor
> (Dreamweaver) highlights it as a "Native Keyword for VBScript" (and

JScript,
> for that matter).
>
> On further inspection, it seems that Dreamweaver makes no distinction
> between VBScript/JScript reserved words and ADO methods and properties in
> terms of its helpful code colouring.
>
> As a prodigious user of Access in the past, I was always aware that Name

is
> a reserved word there, and generally avoid using it anywhere like the
> plague. Just seeing the word in the OP caused bit of a knee-jerk

reaction
> :-)
>
>


In VB6 and VBA it's used to rename a file. Not available in VBScript. I'd
avoid it myself to save the confusion.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com