Coding question
Posted: 13 Mar 2015 5:19
This is a general question concerning code usage and style.
Given:
A list of reference numbers - SLCODES
An internal database - nameRefDB
A temp working internal database - labelDB
Predicate to find the relation to each number - get_lable
is there a difference in the following coding methods to obtain a list of labels from the list of reference numbers:
I started with the second version and realized that the first version may be simpler but I'm not sure if it works the way I think it does and am wondering if there is a possible performance difference?
Any thoughts and recommendations are gladly received.
Regards,
David Snook
Given:
A list of reference numbers - SLCODES
An internal database - nameRefDB
A temp working internal database - labelDB
Predicate to find the relation to each number - get_lable
is there a difference in the following coding methods to obtain a list of labels from the list of reference numbers:
Code: Select all
LNAMES = [Name || CODE = list::getMember_nd(SLCODES), nameRefDB(CODE,LabelCODE), get_label(LabelCODE,Name)]
Code: Select all
foreach CODE = list::getMember_nd(SLCODES) and nameRefDB(CODE,LabelCODE) and get_label(LabelCODE,Name) do
assert(labelDb(Code,Name))
end foreach,
LNAMES = [LName || labelDb(Code,Name)]
Any thoughts and recommendations are gladly received.
Regards,
David Snook