
JoeBean (Customer) asked a question.
Is there a simple way to have variable addresses passed to subroutines so that they can directly modify the value of the original?
Currently, I have a program that interfaces with a C-More Micro and, amongst other things, it requires modifying some UDT structure times. Originally this was done using numeric fields and the UDT.Hour/UDT.Minute values, but after some mishaps with operators I need to display the time in 12hr format.
To minimize code duplication I have a subroutine that handles conversion back and forth, but in order to modify the original variable, eg. V100, I'm passing "100" to the subroutine for it to reference, but it seems to me that there must be a better way that I'm not seeing. How should I be doing this?
Thanks!
It's not entirely clear what your issue is. Can you paste your code you're having trouble with? In order to indirectly modify a memory location, you'll have to pass an index to the subroutine.