PDA

View Full Version : Naming Variables



danbaron
07-10-2010, 08:46
[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.

:oops: :x :twisted:
Dan

Charles Pegge
07-10-2010, 12:57
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

danbaron
08-10-2010, 06:32
[font=courier new][size=8pt]This script runs OK.


' 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


[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.