Page 1 of 1

Case-sensitive @equaloption()

Posted: Wed May 08, 2013 6:14 am
by paues
I have noticed that @equaloption ignores the case of arguments. It would be great if the case of arguments would be respected. That is, I want these two lines to be interpreted differently:

Code: Select all

exec myfile.prg(phrase="HI!") exec myfile.prg(phrase="hi!")
while these two should be interpreted identically:

Code: Select all

exec myfile.prg(phrase="HI!") exec myfile.prg(PHRASE="HI!")

Re: Case-sensitive @equaloption()

Posted: Wed May 08, 2013 8:16 am
by EViews Gareth
A quick test seems to indicate that that behaviour is already seen.

I have a program called test.prg:

Code: Select all

create u 10 string p = @equaloption("foo")
If I issue this command:

Code: Select all

run test(foo="Hello")
Then p is equal to "Hello".

Code: Select all

run test(foo="hello")
results in p = "hello"

Code: Select all

run test(FOO="Hello")
p = "Hello"

Code: Select all

run test(FOO="hello")
p = "hello"

Re: Case-sensitive @equaloption()

Posted: Wed May 08, 2013 8:30 am
by paues
Sorry about writing an untested example. I guess I have been working with unquoted arguments. Is there any difficulty with supporting the same behavior for them?

Re: Case-sensitive @equaloption()

Posted: Wed May 08, 2013 8:43 am
by EViews Gareth
Well that's somewhat un-EViews like. All non-quoted options in EViews are non-case-sensitive.

Re: Case-sensitive @equaloption()

Posted: Wed May 08, 2013 9:31 am
by paues
Ah, I see. Then it would be unwise to change it. And also, thank you! This help me resolve an earlier inquiry.