Iolist for internal keys

Started by Peter.Higgins, November 21, 2020, 02:21:32 PM

Previous topic - Next topic

Peter.Higgins

Is there a way in 2017 or later to write an IOlist for an internal mulitple field key so that the leading fields are padded with nuls?  LEN & CHR do not seem to have that ability.

Mike King

Not certain what you are attempting to do but if what you want is to generate a key for a file knowing the fields then you probably just need to use the KEY function.

For example if you have a  multi-segment key of something like productno, ciientno, and date as key number 3, you can generate a key string with:

k$ = KEY(fileno, kno=3, key=productno$:clientno$:date$)

This will insert any required padding and return you a key based on the values you provided.
Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com