PROCEDURE Level1 * This variable is PRIVATE by default lcText = "ABC" DO Level2 ? lcText ENDPROC PROCEDURE Level2 * Here we are changing the value of the variable in Level1 lcText = "DEF" ENDPROCA much better way of doing the above is;
PROCEDURE Level1 LOCAL lcText lcText = "ABC" lcText = Level2(lcText) ? lcText ENDPROC PROCEDURE Level2 LPARAMETERS pcVar IF pcVar = "ABC" pcVar = "DEF" ELSE pcVar = "DEF" ENDIF RETURN pcVar ENDPROCThe second one is preferred because only Level 1 changes its variables, level 2 only receives a value from level1 and it returns a different value, whihc level1 puts in its variable. The only knowledge that evel2 has of level1 is the value passed, it does not need to know any variable names.