Page 2 of 2
Posted: Mon Mar 15, 2004 4:56 pm
by AlGonzalez
Code: Select all
Structure DoSomethingParms
parm1.s
parm2.l
parm3.l
parm4.s
; etc.
EndStructure
Procedure.l DoSomething(*parms.DoSomethingParms)
Debug *parms\parm1
Debug *parms\parm2
Debug *parms\parm3
Debug *parms\parm4
EndProcedure
dsp.DoSomethingParms\parm1 = "This is the first parameter"
dsp\parm2 = 42
dsp\parm3 = 2 * 42
dsp\parm4 = "4 for illustration can use more! Maybe even arrays?"
DoSomething(dsp)
..
Posted: Mon Mar 15, 2004 11:11 pm
by NoahPhense
AlGonzalez wrote:Code: Select all
Structure DoSomethingParms
parm1.s
parm2.l
parm3.l
parm4.s
; etc.
EndStructure
Procedure.l DoSomething(*parms.DoSomethingParms)
Debug *parms\parm1
Debug *parms\parm2
Debug *parms\parm3
Debug *parms\parm4
EndProcedure
dsp.DoSomethingParms\parm1 = "This is the first parameter"
dsp\parm2 = 42
dsp\parm3 = 2 * 42
dsp\parm4 = "4 for illustration can use more! Maybe even arrays?"
DoSomething(dsp)
Very kewl, thanks much AL for the example.
There ya go techjunkie. I guess now if we
wanted to, we could simulate a jet engine..? lol
- np
Re: ..
Posted: Tue Mar 16, 2004 2:06 am
by techjunkie
NoahPhense wrote:There ya go techjunkie. I guess now if we
wanted to, we could simulate a jet engine..? lol
Hehe... Thanks! Well, I know you can use structures as parameters... BUT it doesn't solve everything... Sometimes you really want parameters... I can name a few examples...
01, When you want the sideeffects of call by reference or call by value
02, When you are in big programming teams
03, When you don't want everything "global"
04, When you are doing a private "module"
That's a few...