View previous topic :: View next topic
|
Author |
Message |
Shah
New User
Joined: 05 Sep 2006 Posts: 18
|
|
|
|
Hi Folks,
I am new to NATURAL. In NATURAL programming how should i get a string without leading spaces. Is there any verb like INSPECT in COBOL.
Thanks,
Shah |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Yes, the equivalent in NATURAL is EXAMINE.
O. |
|
Back to top |
|
|
Shah
New User
Joined: 05 Sep 2006 Posts: 18
|
|
|
|
Hi Ofer71,
Thanks for that. I need some more info. I have a question.
Question:
I have a string variable ABC (A79), this is initialized with 20 characters. While displaying this variable i am getting 59 spaces and the string is displaying from 60th position. How can i remove the spaces.
My target is while display i need only 20 characters (Means with out spaces).
Thanks in advance,
Shah |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Shah -
before the display, add the following statement (assuming your variable name is ABC):
Code: |
EXAMINE FULL ABC FOR ' ' DELETE |
O. |
|
Back to top |
|
|
Shah
New User
Joined: 05 Sep 2006 Posts: 18
|
|
|
|
Ofer,
Thanks , i will try this and let you know.
Thanks,
shah |
|
Back to top |
|
|
Shah
New User
Joined: 05 Sep 2006 Posts: 18
|
|
|
|
Ofer,
I got that but not exactly. i need some more info. As per your EXAMINE verb, her i am getting first 20 characters following spaces. Now my requirement is, output will be only text without spaces.
Please help.
Thanks in advance,
Shah |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can find the ending position of the string after the EXAMINE, but that won't help you, since NATURAL always pad variables with blanks.
O. |
|
Back to top |
|
|
|