Andy Purdey
18th July 2016, 13:20
Hi Guys,
Please take a quick look at the code below -
type = whinh.dll0000.convert.oorg.to.tord(temp)
if type = whltc.tord.production then
select whltc510.serl
from whltc510
where whltc510._index3 = {:type,
:whinr110.orno,
:whinr110.pono,
:whinr110.item}
selectdo
whinr110.qstk = 1
serial = tcyesno.yes
record = strip$(whltc510.serl)
exist = pos(record,record.hold)
if exist = 0 then
if addr.q = tcyesno.no then
rprt_send()
else
write.output.file()
endif
endif
if exist = 0 then
record.hold = concat$("|",record,record.hold)
endif
selectempty
whltc510.serl = ""
serial = tcyesno.no
if addr.q = tcyesno.no then
rprt_send()
else
write.output.file()
endif
endselect
endif
It is my "exist" statement that is causing me a headache, I am looking for a serial (held in "record") that might be present in "record.hold". But when I run this program, the value being returned by "pos" is always 0. even though I can see the value of "record" is present in "record.hold".
so for example
record = "1C3A4XY"
record.hold = "1C3A4XY|ABC1234"
I would expect my statement to return 1, as the string is present. But this is not the case, it is returning 0.
Would really appreciate some assistance.
Thanks
Andy
Please take a quick look at the code below -
type = whinh.dll0000.convert.oorg.to.tord(temp)
if type = whltc.tord.production then
select whltc510.serl
from whltc510
where whltc510._index3 = {:type,
:whinr110.orno,
:whinr110.pono,
:whinr110.item}
selectdo
whinr110.qstk = 1
serial = tcyesno.yes
record = strip$(whltc510.serl)
exist = pos(record,record.hold)
if exist = 0 then
if addr.q = tcyesno.no then
rprt_send()
else
write.output.file()
endif
endif
if exist = 0 then
record.hold = concat$("|",record,record.hold)
endif
selectempty
whltc510.serl = ""
serial = tcyesno.no
if addr.q = tcyesno.no then
rprt_send()
else
write.output.file()
endif
endselect
endif
It is my "exist" statement that is causing me a headache, I am looking for a serial (held in "record") that might be present in "record.hold". But when I run this program, the value being returned by "pos" is always 0. even though I can see the value of "record" is present in "record.hold".
so for example
record = "1C3A4XY"
record.hold = "1C3A4XY|ABC1234"
I would expect my statement to return 1, as the string is present. But this is not the case, it is returning 0.
Would really appreciate some assistance.
Thanks
Andy