Learning Structure Based Programing
hegedus
Being a self-taught Igor programmer (no one else to blame), I would like to continue to upgrade my skills. Is there a good tutorial source to teach myself structure based programming? I appreciate not just examples but also a bit of high level framework discussions of what is the goal of the technique and the pros and cons.
Thanks In Advance.
You can always to a print of a structure at any point to see its contents, and following the progress of a procedure using the debugger helps too.
As for pros/cons, one advantage of structures is that they can be stored and retrieved as "preference" sets. Another is, they can be tools to generate initialization sets ...
variable width
variable height
ENDSTRUCTURE
Function InitializeSmallPanel(MP)
STRUCT MyPanel &MP
MP.width = 120
MP.height = 100
return 0
end
Function InitializeLargePanel(MP)
STRUCT MyPanel &MP
MP.width = 180
MP.height = 120
return 0
end
Function ChoseIt(LargeOrSmall)
variable LargeOrSmall
STRUCT MyPanel MP
if (LargeOrSmall=1)
InitializeLargePanel(MP)
else
InitializeSmallPanel(MP)
endif
NewPanel/W={10,10,10+MP.width,10+MP.height}
return 0
end
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
June 6, 2011 at 11:49 am - Permalink