Collecting parameter values from functions
Is there a simple way to step through and collect the parameter values from a function without calling each parameter by name?
Post Edited By Moderator (Bean (Hitt Consulting)) : 5/13/2008 3:17:15 PM GMT
Post Edited By Moderator (Bean (Hitt Consulting)) : 5/13/2008 3:17:15 PM GMT
Comments
Could you post some code showing what you are doing now ?
P.S. I added a subject to your post for you.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
Show us an example...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
‘incrementing through parameters
For Index = 0 TO 2
tmp1 = parameterinterator(Index)
IF tmp1 = ON
‘close dome
ENDIF
ENDFOR
‘I appreciate that if the three function parameters had been assigned to variables outside ‘the function call that I would not need any parameters and could reach outside the ‘function to get their values. Of course then they would need to be in an array or some ‘other device to allow iteration.
‘
‘I suppose this answers my question of how to proceed
This subroutine closes the dome if any of the lower three state bits are "on." It shifts through each bit since you can't use a variable as a bitIndex.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Paul
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
I thought you could use a variable as a bitIndex as:
state byte
tmp1 byte
FUNCTION_CALL state
FOR bitIndex = 0 TO 2
tmp1 = state.bitIndex
IF tmp1 = 1 THEN CLOSE_DOME
NEXT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Paul
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·