on 04-28-2023 9:40 PM
PLEASE HELP...
This function tries to extract certain lines from a CLOB/Memo field. When I uncomment whatever of the commented lines below, it fails to compilation expecting an "ELSE".. What is wrong;
whileprintingrecords;
Local StringVar Array saLines ;
Local StringVar Array saOLines ;
Local NumberVar nLines ;
Local NumberVar i ;
Local NumberVar x ;
saLines := Split({CustomerStatus.NOTES},chr(10)) ;
saOLines := '' ;
nLines := Count (saLines);
i := 1 ;
do (
if (instr(saLines[i], 'status', 1) > 0 and i < nLines)
then (
x := i ;
do (
saOLines := saOLines + ToText(i) + ' ' + saLines[i] + chr(10) ;
i := i + 1
) while ((i <= nLines) and (trim(saLines[i]) <> '') and (Uppercase(trim(saLines[i])) <> 'STATUS')) ;
// saOLines := iif(x < i, (saOLines + chr(10)), saOLines) ;
// if (x < i) then saOLines := saOLines + chr(10) ;
) ;
i := (i + 1);
) while (i <= nLines) ;
saOLines := saOLines + ToText(i)+ ' '+ToText(nLines) ;
join(saOLines)<br>
Editing caused a loss of formatting for the code. Here is a readable repeat:
Local StringVar Array saOLines := Split(CustomerStatus_WONOTE, Chr(10));
Local Stringvar Lines_with_Status := "";
local numbervar i;
local stringvar delimiter := "";
For i := 1 to UBound(saOlines) do
(
IF instr(saOlines[i], "status") > 0 Then
Lines_with_Status := Lines_with_Status + delimiter + saOlines[i];
delimiter := Chr(10);
);
Lines_with_Status;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.