Word Reserved (1 Viewer)

JPaulo

Developer
Local time
Today, 03:38
Joined
Dec 21, 2009
Messages
185
Hi all;

Why is the word "Local" is reserved for Ms Access ?
 

DCrake

Remembered
Local time
Today, 03:38
Joined
Jun 8, 2005
Messages
8,632
Why does a dog sit down when you say "Sit":p

Don't know, ask Bill Gates, There must be some logical reason behind it, anyway why does it matter?

David
 

JPaulo

Developer
Local time
Today, 03:38
Joined
Dec 21, 2009
Messages
185
Because I was using in code Dim local As String and gave error.

But I found ...

local object

A table, query, form, report, macro or module that remains in the replica when it is created. Neither the object nor the changes to the object are distributed to other members in the replica set.

Thanks for reply.
 

boblarson

Smeghead
Local time
Yesterday, 19:38
Joined
Jan 12, 2001
Messages
32,059
You can almost always avoid a problem if you use the naming convention which gives the datatype too. So, strLocal would work whereas local might not.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 03:38
Joined
Sep 12, 2006
Messages
15,658
using reserved words as field names in tables (which is often referred to here as ill-advised) is one thing, but using reserved (maybe this isnt quite the correct term) language words in VBA is something total different

obviously "local" just happens to be a word reserved by the compiler for something specific, and using it in the wrong context is either not allowed, or will produce a compile error, in the same way that getting your syntax wrong does the same.

not sure about the vba comiler/interpreter, but compilers generally work by turning every variable into a token/memory location, and obvioulsy this particular one will not let you redefine certain tokens

i think some languages do allow you to do so, but if you do redefine reserved words/(function names), you may lose the "real" functionality, which isnt ideal.
 

JPaulo

Developer
Local time
Today, 03:38
Joined
Dec 21, 2009
Messages
185
Thanks for the help Bob, I do not know that was word reserved Local.
 

boblarson

Smeghead
Local time
Yesterday, 19:38
Joined
Jan 12, 2001
Messages
32,059
Thanks for the help Bob, I do not know that was word reserved Local.

No, that's true, but if you always use the naming convention I talked about it would not have come up now, would it? I use that for mine and so never have a problem in that respect.

Now as for field or object names, this is a good reference to check against.
 

Users who are viewing this thread

Top Bottom