From: Hudson R. <hud...@so...> - 2002-09-01 20:51:19
|
Hi Boris, > This program is a good start. Binyamin has already pointed out the problem > with not initializing i. There is another problem in that you may, at some > point, exceed the bounds of the table by specifying an additional offset. > > I don't exactly understand what you are trying to do, but the following > changes should be made. Well boris, I want to create a program like the development/test.code/tdb03, for example, but I've had problems in SEARCH verb, and the results in browser are very strange... :( I noticed that my example didn't explain well. Sorry. I will try to use this way below to show the values in browser... > identification division > program-id. validate2. > author. Hudson Reis. > > data division. > working-storage section. > 01 HtmlLineChars. > 03 HtmlEntry occurs 5 indexed by i. > 03 HtmlChar pic x(001) value spaces. > > procedure division. > SET I TO 1. > > search HtmlEntry varying i > * when HtmlLineChars(i:2) equal " " > WHEN HtmlChar(i) = SPACES > > display "Passed" > end-search > stop run. > > Now, if what you are really trying to do is search pairs of character, the > SEARCH verb is inappropriate. You would want something like: > PROCEDURE DIVISION. > SET i TO 1. > PERFORM VARYING I FROM 1 BY 1 UNTIL i > 4 > IF HtmlChar(i) = SPACES AND HtmlChar(i+ 1) = SPACES > DISPLAY "Passed" > END-IF > END-PERFORM. > STOP RUN. Thanks Hudson |