{ Module 25 Program Parameters Pascal contains provision for the exchange of information between a program and its run time environment by means of program parame- ters. In practice most implementations (including the model implementation) provide only a skeleton frame work which is suffi- cient to map actual data files onto their respective program file variables. The P-machine contains a special P-code to enable a mapping between a named program parameter variable and a corresponding external entity to be established. No restriction on the parameter type is enforced but the P-code operates on the assumption that the entities involved are data files. The following procedures are invoked to generate the parameter mapping code. Each formal parameter is denoted by its associated variable name and an ordinal position number which allows actual/formal correspondence to be established. No means of returning information to the external environment is provided and procedure ReturnProgParameter is consequently a dummy. } program ProgramParams; #include "globals.x" #include "codeutils.pf" procedure OpenProgParameterList; visible; begin if CodeIsToBeGenerated then ProgPmCount := 0 end { openprogparameterlist }; procedure AcceptProgParameter (ParamId : IdEntry); visible; var Size: 0..AlfaSize; i: AlfaIndex; begin if CodeIsToBeGenerated then with ParamId^ do begin with VarAddress do AccessWord(BlockLevel, WordOffset, LoadRefOp); {Pcode3(MapProgParam); } with Name do begin Size := 0; for i := 1 to AlfaSize do if Head[i] <> ' ' then Size := Size + 1; { check tail if necessary } {CodeByte(Size + 1); ProgPmCount := ProgPmCount + 1; CodeByte(ProgPmCount); for i := 1 to Size do CodeByte(ord(Head[i])); } { emit tail if necessary } end end end { acceptprogparameter }; procedure ReturnProgParameter (ParamId : IdEntry); visible; begin end; procedure CloseProgParameterList; visible; begin end; begin { end of module } end.