;[primes.cal] This is XCAL's library and help section for a collection of ; user defined loadable macro's to test the native function: ; ; Primes(Min,Max) ; ; To load this library type: "xcal /c /l:*primes.cal" ; ; Note: This library requires either an ANSI-Terminal or an ; ANSI environment (if running on an IBM-PC). ; /NE ;Disable XCAL file echoing /L:*ansi.cal ;Load the ANSI environment "Loading primes.cal, a library to test & time native function PRIMES(Min,Max)\n\n" /SS/SQ ;Set Quiet mode ; Info(Line,Text)='SaveCursor "\e[Line;1H\e[K" Text' Echo(Cmd)='Info(22,Cmd) RestCursor' Timer(Option)='Info(23,"") "Time:" /T:Option RestCursor' ; P(Min,Max)='Timer(R) /M:0 Primes(Min,Max) Timer(S) ""' ; Pt(Min,Max)='Cls Echo("Pt(Min,Max)") P(Min,Max) ""' "Defined: Pt(Min,Max)\n" ; Pb(Min,Max,Base)='Cls Echo("Pb(Min,Max,Base)") /SS/O:Base P(Min,Max) /SR ""' "Defined: Pb(Min,Max,Base)\n\n" "For help with PT() and PB(), type: /h:primes\n\n" ; /SR ;Restore XCAL's Previous State /Q ;Exit now if loaded with XCAL's command switch "/l:*primes.cal" ; ;********************************************************************** ;******* Start of primes.cal Help Section ******* ;********************************************************************** ;HelpSection Primes(Min,Max) Performance Test Functions ;HelpStart FUNCTION,FUNCTIONS,EXTERNAL,PRIME,PRIMES ;HelpStart PT,PRIMES TEST PT(Min,Max) Test & Time the Primes(Min,Max) function in Radix-10 ;HelpEnd PT,PRIMES TEST ;HelpStart PB,PRIMES TEST PB(Min,Max,Base) Test & Time the Primes(Min,Max) function in any Radix ;HelpEnd PB,PRIMES TEST ;HelpEnd FUNCTION,FUNCTIONS,EXTERNAL,PRIME,PRIMES ;********************************************************************** ;******* End of primes.cal ******* ;**********************************************************************