PC Review


Reply
Thread Tools Rate Thread

Determining Variable Declaration

 
 
Tim Childs
Guest
Posts: n/a
 
      19th Jan 2007
Hi

it may sound a bit strange but is it possible to find, given a variable
name, how it has been declared e.g. string, double etc

i.e without simply finding the declaration statement

thanks

Tim


 
Reply With Quote
 
 
 
 
JE McGimpsey
Guest
Posts: n/a
 
      19th Jan 2007
Take a look at the TypeName method in XL/VBA Help


In article <#oRqPg$(E-Mail Removed)>,
"Tim Childs" <(E-Mail Removed)> wrote:

> Hi
>
> it may sound a bit strange but is it possible to find, given a variable
> name, how it has been declared e.g. string, double etc
>
> i.e without simply finding the declaration statement
>
> thanks
>
> Tim

 
Reply With Quote
 
Tim Childs
Guest
Posts: n/a
 
      19th Jan 2007
Hi

yes that does the trick - THANKS

Is it possible to determine in a similar way the scope of the declaration
e.g. whether it was a Dim or Public etc?
(Last question (today) - I won't bother you again!)

Thanks

Tim


"JE McGimpsey" <(E-Mail Removed)> wrote in message
news:jemcgimpsey-(E-Mail Removed)...
> Take a look at the TypeName method in XL/VBA Help
>
>
> In article <#oRqPg$(E-Mail Removed)>,
> "Tim Childs" <(E-Mail Removed)> wrote:
>
> > Hi
> >
> > it may sound a bit strange but is it possible to find, given a

variable
> > name, how it has been declared e.g. string, double etc
> >
> > i.e without simply finding the declaration statement
> >
> > thanks
> >
> > Tim



 
Reply With Quote
 
Tim Childs
Guest
Posts: n/a
 
      19th Jan 2007
Hi

that is neat - THANKS

Tim

"John Bundy" <(E-Mail Removed)(remove)> wrote in message
news:5E3E6D3C-C418-495B-AAAA-(E-Mail Removed)...
> Does this do what you want
>
> Find a Variable Definition
>
>
> To view the definition of a variable
>
> In the Code window, select the variable whose definition you want to see.
>
>
> From the View menu, choose Definition (SHIFT+F2).
> To return the mouse pointer to its previous position
>
> On the View menu, click Last Position (CTRL+SHIFT+F2).
>
> --
> -John Northwest11
> Please rate when your question is answered to help us and others know what
> is helpful.
>
>
> "Tim Childs" wrote:
>
> > Hi
> >
> > it may sound a bit strange but is it possible to find, given a

variable
> > name, how it has been declared e.g. string, double etc
> >
> > i.e without simply finding the declaration statement
> >
> > thanks
> >
> > Tim
> >
> >
> >



 
Reply With Quote
 
Tim Childs
Guest
Posts: n/a
 
      19th Jan 2007
Hi

Thanks

I do that but on a large Project the variables seem to have multiplied and
many have similar names e.g. I have declared sMsg in several places and want
to get to see what is non-null at the end of the project

Hope that makes some sort of sense

TIm

"Jim Thomlinson" <James_Thomlinson@owfg-Re-Move-This-.com> wrote in message
news:C26CF2B9-10C5-4C04-A067-(E-Mail Removed)...
> Generally speaking when you declare variables there are some standards to
> follow. Some people use the 1 letter prefix while others use a 3 letter
> prefix. That prefix is there to define the declaration type of the

variable.
> For example
>
> dim sMyName as String
> or
> dim strMyName as String
>
> Declare your variables that way and you will never wonder again... Take a
> look at the code posted by most of the MVP and similar and you will notice
> these naming conventions being used...
> --
> HTH...
>
> Jim Thomlinson
>
>
> "Tim Childs" wrote:
>
> > Hi
> >
> > it may sound a bit strange but is it possible to find, given a

variable
> > name, how it has been declared e.g. string, double etc
> >
> > i.e without simply finding the declaration statement
> >
> > thanks
> >
> > Tim
> >
> >
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
variable declaration =?Utf-8?B?SmFuaXM=?= Microsoft Excel Programming 7 24th Jul 2007 01:46 AM
Variable Declaration Vasanth TT Microsoft C# .NET 6 17th May 2007 03:16 PM
Variable Declaration Vasanth TT Microsoft ASP .NET 3 17th May 2007 08:36 AM
variable declaration ? rJ Microsoft VB .NET 6 26th Jun 2006 11:34 AM
Re: Variable Declaration?? Tom Ogilvy Microsoft Excel Programming 1 8th Aug 2003 06:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 AM.