SUBROUTINE STRIPPER(BRANCH) * * Author AMcA with acknowledgements to Stefan Gilboy of ICS (Sales) for * the original idea * Date April 1990 * BEGIN CASE CASE BRANCH = "PRE.INIT" ; GOSUB PRE.INIT CASE BRANCH = "PRE.READ" ; GOSUB PRE.READ CASE BRANCH = "PRE.SAVE" ; GOSUB PRE.SAVE END CASE RETURN PRE.INIT: * * It is necessary to make a copy of all of the symbolics and OCONVs so * that they can be restored later when they have been removed. Anywhere * can be used, this example uses REGISTER(2). Note that as this logic * takes place at PRE.INIT the template structure is still in @RECORD so * this is manipulated * CTR = @RECORD<1> + 1 NEW_REG = "" FOR X = 2 TO CTR * * Note that we store the field name and OCONV for EVERY prompt * regardless of the relevance of same. It is a moot point whether the * extra checks required to implement the extra logic might slow the * program down sufficiently to nullify the benefits accrued therefrom * NEW_REG = @RECORD : @VM : @RECORD * * Don't null down key prompts as this seems to cause problems under * some circumstances. For all other fields though remove the field * name if symbolic to prevent recalculation and the OCONV * IF X > 2 THEN IF @RECORD = "S" THEN @RECORD = "" @RECORD = "" END NEXT * * Now store NEW_REG in REGISTER(2) * @RECORD = FIELDSTORE(@RECORD,"รท",37,1,NEW_REG) RETURN AREV.COMMON: * * Note - cannot be done at top of program as it is not loaded until * after PRE.INIT * $INSERT AREV.COMMON RETURN PRE.READ: GOSUB AREV.COMMON * * If @ID is null then this is the "Dummy" pre read highlighted in the * last issue. Under these circumstances it makes no sense to reload the * missing information * IF @ID # "" THEN FOR X = 1 TO W.CNT W(X)<2> = REGISTER(2) W(X)<13> = REGISTER(2) NEXT END RETURN PRE.SAVE: GOSUB AREV.COMMON * * Remove information * FOR X = 1 TO W.CNT IF W(X)<3> = "S" THEN W(X)<2> = "" W(X)<13> = "" NEXT RETURN