obfusc88 wrote:I thought that variables were Case Sensitive, but I must be wrong? Is it only Labels/SRTs/Dialogs that are Case Sensitive?
Clicking "Search" here on the forums and doing a Google type search for:
"case sensitive" variables finds many posts on this however many of them say variables are case sensitive. This is incorrect or at the very least misleading.
Here's an out-take from
an excellent post by JRL on case sensitivity:
- Case sensitive items:
- Variable values
Case insensitive items:
- User defined variable names
- System variable names (Help singles out OS_VER, WIN_DIR, SYS_DIR and TEMP_DIR as variables that "store their values in upper case." However, testing these with version 9, all of them worked for me when typed in lower case.)
So in your case, MM and mm both refer to the same variable.
To see it in action:
- create the following new macro:
- click the Watch List tab in the editor so it is open and you can watch the variables being created and assigned values
- make sure the cursor is positioned at the beginning of the first line
- click the Debug/Step tool bar icon or hit F8 to single step through the lines and watch as variables are created and assigned values
- you'll see it create a variable called MM and set its value to 02
- another F8 will show you that a new variable called mm is not created... it just updates the MM variable to 20
Side Note: I believe it still does not say anywhere in the Help File that user defined variable names are not case sensitive. Marcus if this has been added somewhere, please say where but if not, perhaps it would be a nice addition... and with an example would be best. As we can see from this post, it is something new people still learn the hard way.