tags:

views:

57

answers:

0

I am using the ScriptControlClass, for reference and I thought JScript was case sensitive... However, my user base has surprised me... I have several methods I have provided the users in all upper such as: IF, EMPTY, AGE, PARSE, etc...

Well, today a user filed a defect that issampgroup was not working. I investigated and informed the user that the function was ISSAMPGROUP and that it was working correctly... The user responded with, all the other functions except IF worked in lower case. So I ran a quick test and all but 5 of my functions work in a case insensitive manner... I was very surprised to see age and Age as well as all other variations work and work correctly. Below is a sample of how my functions are declared and I verified that Jscript function is calling my C# each time…

this.scriptEngine.AddCode(@"function AGE (birthDate) { return cmd.Age(birthDate); };");
this.scriptEngine.AddCode(@"function ISSAMPGROUP (value) { return cmd.IsSampleGroup(value); };");

Which leaves me confused as to why some functions work in a case insensitive manner and other do not. For example, AGE is case insensitive, yet ISSAMPGROUP is case sensitive.