2' '75ư>HELPNA\NhNN:lԮCONTINUE n((px`EXIT&%p=lHALTމPlԮ`dSTEP 14߉lg STOP߉X^F%EFSTOP ,,OFFg^w@߉UpSHOW X$AnswerT߉WpO0gp߉.Od0@g|߉0@|ŻOdg0@ModelsFactorl.gpsLFeCFEOdIhLdIhKhE(((((((((({\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern Courier New;}} {\colortbl\red0\green0\blue0;} \deflang1033\pard\tx1200\tx2400\tx4450\plain\f2\fs20 ; GPSS World Sample File - FACTORL.GPS \par ; \par ; This model uses a PLUS Procedure to calculate \par ; factorials. \par ; You can either change the INITIAL statement to \par ; calculate factorials based on different values \par ; or use the INITIAL command after the model is \par ; Translated to initialize the SAVEVALUE Facval. \par ; After the model has run, you can press the \par ; function key to display the value of the \par ; calculation in the status line. This function \par ; key has been preset to display X$Answer. \par ; This PLUS Procedure is designed to calculate \par ; Factorials for positive integers only. \par ; \par \tab INITIAL \tab X$Facval,10 \par \tab GENERATE\tab 1 \par \tab SAVEVALUE\tab Answer,(Factorial(X$Facval)) \par \tab TERMINATE\tab 1 \par \par \par PROCEDURE Factorial(Arg1) BEGIN \par TEMPORARY Result; \par \tab \par Result=1; \par \par WHILE(Arg1>1) DO BEGIN \par Result=Result#Arg1; \par Arg1=(Arg1-1); \par END; \par \par RETURN Result; \par \par END; \par \par \par }