DO CASE CASE pnTipoPrcTer=1 this.parent.LinPrUnit.Value=artigos.n_pvp1 CASE pnTipoPrcTer=2 this.parent.LinPrUnit.Value=artigos.n_pvp2 CASE pnTipoPrcTer=3 this.parent.LinPrUnit.Value=artigos.n_pvp3 CASE pnTipoPrcTer=4 this.parent.LinPrUnit.Value=artigos.n_pvp4 OTHERWISE * the otherwise clause is optional, but can be used to give * default code when none of the conditions are met ENDCASEYou could also build a command string and macro-execute it (this is not tested):
cString=[this.parent.LinPrUnit.Value=artigos.n_pvp]+; STR(pnTipoPrcTer,1) &cString>if pnTipoPrcTer=1