Results 1 to 3 of 3

Thread: Naming Variables

  1. #1
    thinBasic MVPs danbaron's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    1,378
    Rep Power
    152

    Naming Variables

    [font=courier new][size=8pt]Here are the variable naming restrictions from the help file.

    Naming Restrictions

    Must begin with an alphabetic character.
    Cannot contain embedded period, space and, in general, punctuation.
    Must not exceed 64 characters.
    Must be unique in the scope in which it is declared.


    My experience is different.

    Must begin with an alphabetic character or underscore.
    May contain only alphabetic characters, underscores, and digits.
    May be of any length.
    Must be unique in the scope in which it is declared.
    Is case insensitive.



    Dan


    "You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump." - W.C.Fields

  2. #2

    Re: Naming Variables


    I always prefer short names, particularly when dealing with anything mathematical. But you have just given me an idea about supporting long descriptive names. I will propose it

    Charles

  3. #3
    thinBasic MVPs danbaron's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    1,378
    Rep Power
    152

    Re: Naming Variables

    [font=courier new][size=8pt]This script runs OK.

    [code=thinbasic]' Empty console script created on 10-07-2010 21:00:05 by (ThinAIR)

    Uses "console"

    ' Dimension a variable with a name of 1002 characters.
    Dim _tmhjbiukj98iuo7uyi68tirhf_nvjgmbkhiu98i7u6jymhnbjgutjgutolforkgitjyuh798oi0gjbmnhiyto60798oilukhmbkgor050129586u7hknjiuot96ut940rohljmnkhnvhfbchdyr75869708oukjmnkhiykhithgrgut4978yu7kliohurhfnvjghmbkhituyuydhfytjguy48675902tjguyjhknmbjguty6879tjghuyigkhmnkjiukjigjhuyfhgytnbgjhmniu897867564tyfhgjvnoyuhukjiyhikjocgfvhgjtuyedfhgnbjhutyichfjgn687uyhjbnghfnchfyr5687utyghfbvghtyrhfyrhdyehfjgutjhyix657tyrhfgjtuyjh798iuutyrhfgnvbkhmniehftuyjhnbhg3857yuthgjbmhkjiulop9i08ou67tu675yr47euthgjbnkghi86ut84eythfrufjvnbhgyu678yu9ikjuogplmkjnjbhgythfgvhd47ey5htgfnvbfklmkjmniujkihkuij89uiyjhuthgybnvhfgcfdrefwrsfdgcbfhtgydkyijolaskrikf02iwuthfnbjhmvkfmcuthyjg867uyyutjgu786ut75rtfhgytvngjhbuy87urythgnfhvgytetr54tery576utiukjolpjknmhkbjgnvhfut6789ehfytjfnvhgbkhgitykhiuljoipkrifkyihk8iukjiyjhutgjyuhjdhfngvjgnbjsnxhdnbjgmkcjfnvjgnvurjyu58679iyjgnbjgnvdyerhfturjfkglmkkjmhngbfhtyridjfzsgfbv768593012whfgdnvhfytjguyihkuojlikfjgnbhfbcgfbdhryeujdnfhgkeoritjguyjhasythg76uy87iu98orutjgmnkhmbjgutjgutiohljknmgjruthfyr3 As Integer

    ' Change it to uppercase and assign a value to it.
    _TMHJBIUKJ98IUO7UYI68TIRHF_NVJGMBKHIU98I7U6JYMHNBJGUTJGUTOLFORKGITJYUH798OI0GJBMNHIYTO60798OILUKHMBKGOR050129586U7HKNJIUOT96UT940ROHLJMNKHNVHFBCHDYR75869708OUKJMNKHIYKHITHGRGUT4978YU7KLIOHURHFNVJGHMBKHITUYUYDHFYTJGUY48675902TJGUYJHKNMBJGUTY6879TJGHUYIGKHMNKJIUKJIGJHUYFHGYTNBGJHMNIU897867564TYFHGJVNOYUHUKJIYHIKJOCGFVHGJTUYEDFHGNBJHUTYICHFJGN687UYHJBNGHFNCHFYR5687UTYGHFBVGHTYRHFYRHDYEHFJGUTJHYIX657TYRHFGJTUYJH798IUUTYRHFGNVBKHMNIEHFTUYJHNBHG3857YUTHGJBMHKJIULOP9I08OU67TU675YR47EUTHGJBNKGHI86UT84EYTHFRUFJVNBHGYU678YU9IKJUOGPLMKJNJBHGYTHFGVHD47EY5HTGFNVBFKLMKJMNIUJKIHKUIJ89UIYJHUTHGYBNVHFGCFDREFWRSFDGCBFHTGYDKYIJOLASKRIKF02IWUTHFNBJHMVKFMCUTHYJG867UYYUTJGU786UT75RTFHGYTVNGJHBUY87URYTHGNFHVGYTETR54TERY576UTIUKJOLPJKNMHKBJGNVHFUT6789EHFYTJFNVHGBKHGITYKHIULJOIPKRIFKYIHK8IUKJIYJHUTGJYUHJDHFNGVJGNBJSNXHDNBJGMKCJFNVJGNVURJYU58679IYJGNBJGNVDYERHFTURJFKGLMKKJMHNGBFHTYRIDJFZSGFBV768593012WHFGDNVHFYTJGUYIHKUOJLIKFJGNBHFBCGFBDHRYEUJDNFHGKEORITJGUYJHASYTHG76UY87IU98ORUTJGMNKHMBJGUTJGUTIOHLJKNMGJRUTHFYR3 = 1

    ' Change it back to lowercase and print the value.
    Console_WriteLine _tmhjbiukj98iuo7uyi68tirhf_nvjgmbkhiu98i7u6jymhnbjgutjgutolforkgitjyuh798oi0gjbmnhiyto60798oilukhmbkgor050129586u7hknjiuot96ut940rohljmnkhnvhfbchdyr75869708oukjmnkhiykhithgrgut4978yu7kliohurhfnvjghmbkhituyuydhfytjguy48675902tjguyjhknmbjguty6879tjghuyigkhmnkjiukjigjhuyfhgytnbgjhmniu897867564tyfhgjvnoyuhukjiyhikjocgfvhgjtuyedfhgnbjhutyichfjgn687uyhjbnghfnchfyr5687utyghfbvghtyrhfyrhdyehfjgutjhyix657tyrhfgjtuyjh798iuutyrhfgnvbkhmniehftuyjhnbhg3857yuthgjbmhkjiulop9i08ou67tu675yr47euthgjbnkghi86ut84eythfrufjvnbhgyu678yu9ikjuogplmkjnjbhgythfgvhd47ey5htgfnvbfklmkjmniujkihkuij89uiyjhuthgybnvhfgcfdrefwrsfdgcbfhtgydkyijolaskrikf02iwuthfnbjhmvkfmcuthyjg867uyyutjgu786ut75rtfhgytvngjhbuy87urythgnfhvgytetr54tery576utiukjolpjknmhkbjgnvhfut6789ehfytjfnvhgbkhgitykhiuljoipkrifkyihk8iukjiyjhutgjyuhjdhfngvjgnbjsnxhdnbjgmkcjfnvjgnvurjyu58679iyjgnbjgnvdyerhfturjfkglmkkjmhngbfhtyridjfzsgfbv768593012whfgdnvhfytjguyihkuojlikfjgnbhfbcgfbdhryeujdnfhgkeoritjguyjhasythg76uy87iu98orutjgmnkhmbjgutjgutiohljknmgjruthfyr3

    WaitKey
    [/code]

    [font=courier new][size=8pt]Note that all 1002 characters in the variable name are significant. You can check this for yourself, by changing the last character in one of the three variable appearances in the code.
    "You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump." - W.C.Fields

Similar Threads

  1. Syntax Preferences Poll - Naming Variables
    By kryton9 in forum Development
    Replies: 5
    Last Post: 15-05-2008, 02:26

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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