rtvSEX = retrieve sex
matSEX = materilize sex (write it out)
so, given each circumstance, I can either inspect it, or write it out (when called 'directly')
any down the road problems you can think of with this?
Code: Select all
function rtvSEX(iptr)
local thisPTR = iptr
local sex = matSEX(thisPTR)
return sex
end -- fn matSEX
function matSEX(iptr)
local thisPTR = iptr
tblSEX = tblSEX or {}
cwsex = cwsex or 6
local sex = string.sub(fhGetItemText(thisPTR,'~.SEX'), 1, 1)
if sex == '' then
sex = 'U'
end
****
local cs = debug.getinfo(2, 'n')
if cs.name ~= 'rtvSEX' then
table.insert(tblSEX, sex)
end
****
return sex
end -- fn matSEX