Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    is there a max length on variable names? (Word 2002 XP SR3)

    is there a max imum length/size on variable names?
    and what will happen if my variable names are over this limit?

    for example if the max length is 25 characters. and my var name is 30 characters. is the last 5 characters ignored? and could this be dangerous as wrong var names are set/assigned?

    eg max length is reached with variable "csPrinterControl_StapleOnLandscape"

    the following variable names declared are over the limit...
    csPrinterControl_StapleOnLandscapeCanon
    csPrinterControl_StapleOnLandscapeLexmark
    csPrinterControl_StapleOnLandscapeHP

    the code checks the printer type however as the max is reached it doesnt matter as the 1st variable read is set
    so printer type is lexmark
    set the variable name to "csPrinterControl_StapleOnLandscapeLexmark"

    however the first variable is set "csPrinterControl_StapleOnLandscape"Canon - which is required to set the canon printer and as a consequence errors are generated?

    mmm.... <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

    diana

  2. #2
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: is there a max length on variable names? (Word 2002 XP SR3)

    Hi Diana
    <hr>Naming Conventions
    Whenever you want to declare a variable always follow below naming conventions.

    The variables always begin with an alphabet instead of any number.
    They should not contain spaces.
    They must be unique in their names.
    If you want to define a long name than always concatenate the names with and underscore.
    Ex. Fname_Lname

    Always start your variable name with capital alphabet letter and when the second word starts in the variable make it capital too.
    They must not be larger than 255 characters in length.

    <hr>
    The foregoing was found here

    H.T.H.
    Regards
    Don

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: is there a max length on variable names? (Word 2002 XP SR3)

    thank you Don ...thats exactly what i was after <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    diana

Posting Permissions

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