I usually have a bigger class of task or assignment, from which the individual information is pulled out. An example structure for renaming could be:
It looks intimidating at first, but is actually very simple. The important part is that one can work explicitly with pairs of values (e.g. the use of .third).
Best, Sergiy Radyakin
Code:
clear all class Pair { string from string to } class Plan { array content } .renaming=.Plan.new .tmp=.Pair.new .renaming.content[1]=.tmp .renaming.content[1].from="a1" .renaming.content[1].to="b1" .renaming.content[2]=.tmp .renaming.content[2].from="a2" .renaming.content[2].to="b2" .renaming.content[3]=.tmp .renaming.content[3].from="a3" .renaming.content[3].to="b3" .renaming.content[4]=.tmp .renaming.content[4].from="a4" .renaming.content[4].to="b4" display "`.renaming.content[1].from'" display "`.renaming.content[2].from'" display "`.renaming.content[3].from'" display "`.renaming.content[4].from'" .third=.renaming.content[3] display "`.third.from'"
It looks intimidating at first, but is actually very simple. The important part is that one can work explicitly with pairs of values (e.g. the use of .third).
Best, Sergiy Radyakin
Comment