DEFINE CLASS MyCodes AS Relation PROCEDURE GetDescription(Code) Local RetVal DO CASE CASE m.Code = "E" RetVal = "MyDescription" CASE m.Code = "X" RetVal = "Other" ENDCASE RETURN m.RetVal ENDPROC PROCEDURE GetCode(Descript) * More Case Structure Here. ENDPROC PROCEDURE CodeByNo(Number) * Return a code given an integer. * A easy was to "FOR X=1 TO N" to * iterate thru the codes for use in * stocking Combos and the like. DO CASE CASE m.Number = 1 RetVal = "E" && Return the first code. CASE m.Number = 2 && Return the second code. ENDCASE ENDPROC ENDDEFINE oCodes = NEWOBJECT("MyCodes", "ThisPRG.PRG") *Use a View as a RecordSource for the GRID. SELECT *, PADR(oCodes.GetDescript(Source.Code), 16) AS Descript ; FROM Source WHERE ?You can use DEFINEs and INCLUDEs if you wish, but there's really no reason. Everything to do with using these codes and descriptions should be done here, in this one place.