View previous topic :: View next topic
|
Author |
Message |
vrakeshmbt
New User
Joined: 17 Aug 2005 Posts: 30
|
|
|
|
Hi All,
I have a variable of size X(200). Say in this variable i will write a sentence. Now if i want to search for a particular word, How can i implement it? Can anyone plz let me know the solution ASAP. |
|
Back to top |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
Hi,
I Think you can use the inspect stmt to check for the characters and tally them
,after that print for the tally identifier if more than 1 means the string has been found.
Regards,
Naga samba siva rao varanasi. |
|
Back to top |
|
|
Aji
New User
Joined: 03 Feb 2006 Posts: 53 Location: Mumbai
|
|
|
|
Hi
Please go through the logic given below.
INSPECT FUNCTION REVERSE(TEXT1) TALLYING
L FOR LEADING SPACE
compute l = length of text1 - l
INSPECT FUNCTION REVERSE(TEXT2) TALLYING
x FOR LEADING SPACE
compute x = length of text2 - X
perform until m > l
if text1(m)= text2
add 1 to no-oc
end-if
add 1 to m
end-perform.
Where text2 is searching in text1 and no-oc is no of occerence.
Regards
Aji Cherian |
|
Back to top |
|
|
balajiofcrrcoe
New User
Joined: 07 Jul 2005 Posts: 41 Location: chennai
|
|
|
|
Hi,
try like this also it's working
MOVE 'NAGA NAGA SIVA RAO' TO A.
INSPECT A TALLYING C FOR ALL 'NAGA'.
DISPLAY C.
result is 2
please let me know in case of further clarifications.
Regards,
Naga samba siva rao varanasi |
|
Back to top |
|
|
|