¿ªÔÆÌåÓý

Re: #VMCE #rexx EE goes XEDIT - compiling a wish list #VMCE #rexx


 

CONGRATULATIONS!!!


On Sat, Nov 12, 2022, 01:39 Martin Scheffler <San-Lorenzo@...> wrote:
The spirit has left the bottle and will never return: EE has run its first REXX macro.

This version is still incomplete and not stable enough for public display.
Now there is MUCH legwork to be done with the EXTRACT command ... and all existing EE commands have to "learn" how to provide an XEDIT-compatible return code.

Martin

The REXX macro below produces the same results on LCM+L's VM/SP Release 5.


File: PRIMEXED LISTING? A1?? RECFM: V LRECL: 125(125) Lines:? 100 Current:?? 12?
?====>???????????????????????????????????????????????????????????????????????? ?
??? 0 * * * Top of File * * *????????????????????????????????????????????????? ?
??? 1 1 is prime?????????????????????????????????????????????????????????????? ?
??? 2 2 is prime?????????????????????????????????????????????????????????????? ?
??? 3 3 is prime?????????????????????????????????????????????????????????????? ?
??? 4 4 = 2*2????????????????????????????????????????????????????????????????? ?
??? 5 5 is prime?????????????????????????????????????????????????????????????? ?
??? 6 6 = 2*3????????????????????????????????????????????????????????????????? ?
??? 7 7 is prime?????????????????????????????????????????????????????????????? ?
??? 8 8 = 2*2*2??????????????????????????????????????????????????????????????? ?
??? 9 9 = 3*3????????????????????????????????????????????????????????????????? ?
?? 10 10 = 2*5???????????????????????????????????????????????????????????????? ?
?? 11 11 is prime????????????????????????????????????????????????????????????? ?
?? 12 12 = 2*2*3?????????????????????????????????????????????????????????????? ?
?? 13 13 is prime????????????????????????????????????????????????????????????? ?
?? 14 14 = 2*7???????????????????????????????????????????????????????????????? ?
?? 15 15 = 3*5???????????????????????????????????????????????????????????????? ?
?? 16 16 = 2*2*2*2???????????????????????????????????????????????????????????? ?
?? 17 17 is prime????????????????????????????????????????????????????????????? ?
?? 18 18 = 2*3*3?????????????????????????????????????????????????????????????? ?
?? 19 19 is prime????????????????????????????????????????????????????????????? ?
?? 20 20 = 2*2*5?????????????????????????????????????????????????????????????? ?
?? 21 21 = 3*7???????????????????????????????????????????????????????????????? ?
?? 22 22 = 2*11??????????????????????????????????????????????????????????????? ?
?? 23 23 is prime????????????????????????????????????????????????????????????? ?
Modified?????????????????????????????????? XeDiT V1.3.0_221112-0730,? 6 File(s)
?
?????????????????????????????????????????????????????????????????????????????? ?
?????????????????????????????????????????????????????????????????????????????? ?
File: PRIMEXED EXEC???? A1?? RECFM: V LRECL: 125(255) Lines:?? 33 Current:?? 12
?
?====>???????????????????????????????????????????????????????????????????????? ?
??? 0 * * * Top of File * * *????????????????????????????????????????????????? ?
??? 1 /* REXX */?????????????????????????????????????????????????????????????? ?
??? 2 address "XEDIT"????????????????????????????????????????????????????????? ?
??? 3????????????????????????????????????????????????????????????????????????? ?
??? 4 default = 23???????????????????????????????????????????????????????????? ?
??? 5 parse arg limit .??????????????????????????????????????????????????????? ?
??? 6 if datatype(limit,"W") = 0 then limit = default????????????????????????? ?
??? 7 if limit < 7 then limit = default??????????????????????????????????????? ?
??? 8 prime. = "0"???????????????????????????????????????????????????????????? ?
??? 9 number. = "0"??????????????????????????????????????????????????????????? ?
?? 10????????????????????????????????????????????????????????????????????????? ?
?? 11 "bottom"???????????????????????????????????????????????????????????????? ?
?? 12 do i = 1 to limit??????????????????????????????????????????????????????? ?
?? 13?? is_prime = 1 /* in the beginning we assume it is prime */????????????? ?
?? 14?? factors = ""?????????????????????????????????????????????????????????? ?
?? 15?? m = i????????????????????????????????????????????????????????????????? ?
?? 16?? do j = 2 to prime.0??????????????????????????????????????????????????? ?
?? 17???? do forever?????????????????????????????????????????????????????????? ?
?? 18?????? if (m // prime.j) <> 0 then leave????????????????????????????????? ?
?? 19?????? is_prime = 0?????????????????????????????????????????????????????? ?
?? 20?????? factors = factors"*"prime.j??????????????????????????????????????? ?
?? 21?????? m = m % prime.j??????????????????????????????????????????????????? ?
?? 22???? end????????????????????????????????????????????????????????????????? ?
?? 23?? end??????????????????????????????????????????????????????????????????? ?
?? 24?? if is_prime = 1 then do??????????????????????????????????????????????? ?
?? 25???? k = prime.0 + 1????????????????????????????????????????????????????? ?
?? 26???? prime.k = i????????????????????????????????????????????????????????? ?
?? 27???? prime.0 = k????????????????????????????????????????????????????????? ?
?? 28???? "input" i "is prime"???????????????????????????????????????????????? ?
?? 29?? end??????????????????????????????????????????????????????????????????? ?
?? 30?? else do??????????????????????????????????????????????????????????????? ?
?? 31???? "input" i "=" substr(factors,2)????????????????????????????????????? ?
?? 32?? end??????????????????????????????????????????????????????????????????? ?
?? 33 end????????????????????????????????????????????????????????????????????? ?
?? 34 * * * End of File * * *????????????????????????????????????????????????? ?
Unchanged????????????????????????????????? XeDiT V1.3.0_221112-0730,? 7 File(s)
?

Join [email protected] to automatically receive all group messages.