Re: Avoidinig globals
From: Phill. W (P.A.Ward_at_o-p-e-n-.-a-c-.-u-k)
Date: 03/08/05
- Next message: Iain Norman: "Re: admin Control panel"
- Previous message: Tim: "Re: Avoidinig globals"
- In reply to: Tim: "Avoidinig globals"
- Next in thread: Tim: "Re: Avoidinig globals"
- Reply: Tim: "Re: Avoidinig globals"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 8 Mar 2005 11:17:04 -0000
"Tim" <al@gahnstrom.se> wrote in message
news:MC2Xd.19099$d5.146369@newsb.telia.net...
> I mean that if I forget to dim a a local variable but there is already
> such a variable in the global scope then my function will use the
> global variable without me intending it too.
Welcome to the World of Naming Conventions.
There are those who sneer at prefixes of /any/ kind on variable
names, because they know (or, rather, their mega-expensive
IDE tells them) what DataType a variable is and whether it's
Private, Public, Global or whatever.
Those of us in the Real World, who still have to fight the Good
Fight [occasionally] with the likes of Notepad prefer to be able
to read this kind of thing for ourselves.
At the /very/ least, include a "Scope" prefix on your variable names,
as in
iCount ' [local] Integer variable
smCount ' String Variable [at *M*odule (or class) level]
lgCount ' Long variable [*G*lobal]
That way, you /can't/ get your variables mixed up.
HTH,
Phill W.
- Next message: Iain Norman: "Re: admin Control panel"
- Previous message: Tim: "Re: Avoidinig globals"
- In reply to: Tim: "Avoidinig globals"
- Next in thread: Tim: "Re: Avoidinig globals"
- Reply: Tim: "Re: Avoidinig globals"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|