Consulting

Results 1 to 3 of 3

Thread: Solved: Is there a complete list of true type variable declarations

  1. #1
    Knowledge Base Approver
    Space Cadet
    VBAX Tutor sandam's Avatar
    Joined
    Jan 2005
    Location
    London
    Posts
    292
    Location

    Solved: Is there a complete list of true type variable declarations

    I'm just curious because I found a few in the Word VBA library but not for all the data types I'm using (specifically byte and boolean). because I figure it will make the code run more efficiently. I've replaced as string with $ and as integer with % and it works for function calls and arrays of data types which is cool.


  2. #2
    VBAX Regular zilpher's Avatar
    Joined
    Nov 2004
    Location
    Swindon, UK
    Posts
    30
    Location
    Byte and Boolean don't have a type declaration character.

    It's also no more efficient to use type declaration characters, except in typing effort, yet this is minimal. There was a view a little while ago that type declaration characters would be unsupported in VB7 (.Net) but that hasn't happened yet.

    It is not considered good practice to use type declaration characters, don't ask me why. My personal preference is to not use them.

    A full list: http://support.microsoft.com/?kbid=191713

    HTH

  3. #3
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    I think the main reason for it being considered bad form is that it lacks clarity. Most people don't know the characters (they probably know $, and maybe guess that # is a number but not know which type; after that they come unstuck). The concept belongs to yesterday.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •