[Q] SPL code to scan a char(n) variable
Posted in 1997
Context:
o IBM RS6k F40, AIX 4.1.5
o Informix SE 7.13UC2
o dbaccess
Hi.
I'm trying to write some SPL code to parse a DATETIME field which has been
converted into a CHAR array. I want to do this kind of thing:
for l_nIndex in ( 1 to 20 step 1 )
if l_strDateTimeRenderedAsString[l_nIndex] == ' ' then
{stuff}
else
{other stuff}
end if
end for
i.e. I want to extract the Nth character from a string. The above code
produces an error which implies that only constants are allowed within the
[] construct. Can this be true? Is there another way of going about it ?
TIA
Ian
--
Ian Bishrey
Systems Manager
Kam Circuits Ltd, Station Road, Calne, Wilts, SN11 0JT. UK.
http://www.kam.com
Tel: +44 1249 815262
Fax: +44 1249 814726