‎2009 Aug 21 8:37 PM
Lets say user inputs 0.123 0.456
How can I find out if the input field has a gap or space in it.
I tried
FIND ' ' in inputbut this gives out subrc = 0 even when there is no space. Any ideas.
‎2009 Aug 21 9:19 PM
Hi,
use this code... its tested and is working fine....
parameters input(10) type c.
data w_rc type i.
perform check_space using input changing w_rc.
if w_rc = 1.
write 'Space available'.
else.
write 'No Space'.
endif.
form check_space using value(p_input) like input changing p_rc.
data : lw_index type i value 0.
while p_input+lw_index <> ' '.
if p_input+lw_index(1) = ' '.
p_rc = 1.
exit.
endif.
add 1 to lw_index.
endwhile.
endform.Regards,
Siddarth
‎2009 Aug 21 9:17 PM
find regex [ [:space:] ] in input.you have to use regex. ->regular expression. put F1 on it for more help
‎2009 Aug 21 9:19 PM
Hi,
use this code... its tested and is working fine....
parameters input(10) type c.
data w_rc type i.
perform check_space using input changing w_rc.
if w_rc = 1.
write 'Space available'.
else.
write 'No Space'.
endif.
form check_space using value(p_input) like input changing p_rc.
data : lw_index type i value 0.
while p_input+lw_index <> ' '.
if p_input+lw_index(1) = ' '.
p_rc = 1.
exit.
endif.
add 1 to lw_index.
endwhile.
endform.Regards,
Siddarth