‎2009 Jan 15 11:56 AM
I am using a if statement like
if n = 'times'
else.
endif.
N is a parameter defined on screen..Now if the user enters TIMES (caps lock on) ideally it should pass the condition ( Upper case doesnt make any difference in my program ) But it is failing because of IF statement being case sensitive.
How should I make my IF statement case insensitive... ie whether user enters 'times' or 'TIMES' it should pass the condition??
‎2009 Jan 15 11:59 AM
HI Priya,
If you have already hardcoded the condition with small letters, then simply translate the N value with small letters & then pass to if condition.
translate N lowercase.
if n = 'times'
{ exp}
else.
{ exp }
endif.Best regards,
Prashant
‎2009 Jan 15 11:59 AM
HI Priya,
If you have already hardcoded the condition with small letters, then simply translate the N value with small letters & then pass to if condition.
translate N lowercase.
if n = 'times'
{ exp}
else.
{ exp }
endif.Best regards,
Prashant
‎2009 Jan 15 11:59 AM
instead of n = 'times'
use
n eq 'times'
nd what did u declare n as
is n a character or string
if u declared n as string
then use n eq times
‎2009 Jan 15 12:00 PM
hi,
to your select-parameter give lower-case,
what ever the user enters TIMES ot times it accepts lin lower case and you can pass the if condition.
parameter: p_file(255) type c lower case.
regards,
nazeer
‎2009 Jan 15 12:00 PM
hi,
opps.. posted tiwce..
ignore
to your select-parameter give lower-case,
what ever the user enters TIMES ot times it accepts lin lower case and you can pass the if condition/
regards,
nazeer
Edited by: N a z e e r on Jan 15, 2009 5:33 PM
‎2009 Jan 15 12:04 PM
Hi,
PARAMETER: n type string LOWER CASE.
If n = 'TIMES'.
WRITE:/ 'hi'.
else.
WRITE:/ 'wrong'.
endif.
The above code will work for ur requirement.
Thanks.
‎2009 Jan 15 12:06 PM
Translate the value in upper case before passing it to if condition.
‎2009 Jan 15 12:11 PM
Hi,
Use Hard coded value in Capital Letter.
PARAMETER: n type string .
If n EQ 'TIMES'.
EXP.
else.
WRITE:/ EXP.
endif.
Hope it will work for your requirment.
Thanks
Arun Kayal.
Thanks.