function ModifyFoo (roFoo) * ... roFoo = m.oNewFoo return <whatever> * elsewhere ... if ModifyFoo(@m.g_oFoo) == <whatever> * ... endifto
function ModifyFoo (oFoo, ruStatus) * ... ruStatus = <whatever> return m.oNewFoo * elsewhere ... local uStatus g_oFoo = ModifyFoo(m.g_oFoo, @m.uStatus) if m.uStatus == <whatever> * ... endifBut this means that the ModifyFoo() call can no longer participate in things like CASE statements and other conditionals unless a wrapper is written:
function ModifyGlobalFoo local uStatus g_oFoo = ModifyFoo(m.g_oFoo, @m.uStatus) return m.uStatus if ModifyGlobalFoo() == <whatever> * ... endifBottomline: the ModifyFoo() code has to be changed even though it does not deal with any globals directly, and the code that calls ModifyFoo() has to be changed one way or another. And the whole shebang just got a bit messier instead of leaner/meaner/cleaner during maintenance. ;-)