hello all. I'm having an issue removing a set of characters from a string that is being passed in a csv file. I'm passing identifiers in the csv file that will do specific actions but I'm having an issue to get everything to work. Currently this is bolding and italicizing and line breaking but the '~' are still showing. would someone tell me what I am doing wrong?
<b> = bold
<i> = italic
~ = line break
This is the code im using:
define(&i, integer, 0)
define(&j, integer, 0)
define(&s, string, '')
define(&st, string, '')
% Put your variable text in the &s variable.
&s := @(176,1,4000) + '~'
&st := ''
for(&i,1,1,length(&s))
% Check if we enter a tag.
if(mid(&s, &i, 1) = '<')
&j := &i
&st := ''
repeat
&st := &st + mid(&s, &j, 1)
&j := &j + 1
until(mid(&s, &j, 1) = '>')
&st := &st + '>'
&i := &j + 1
endif()
% Handle the different styles.
if((&st = '</b>') or (&st = '</i>'))
setstyleext(&Default, 11.00,0,[100],100)
endif()
if(&st = '<b>')
setstyleext(&bold, 11.00,0,[100],100)
endif()
if(&st = '<i>')
setstyleext(&italic, 11.00,0,[100],100)
endif()
if((mid(&s, &i, 1) = '~'))
crlf(.3)
endif()
% Show the text.
show(mid(&s, &i, 1))
% Handle moving to next line if the line is longer
% than a certain value(by default 4.0 inches long,
% replace it with whatever you need).
if((mid(&s, &i, 1) = ' ') and (¤t.x >= 6.45))
crlf()
endif()
endfor()
crlf(.5)
&s := @(177,1,4000) + '~'
search(&s, '~')
beginparagraph(0,7,0,'leftright',0.01)
setstyleext(&Default,11.00,0,[100],100)
show(&s)
endparagraph()
if(&sig_image)
crlf(.05)
$picture11
crlf(.15)
else
crlf()
endif
endsearch()
&obj_height := &physical.y