Module Checkit { global out$ document out$ Function PrepareStream$ (buf$) { \\ get a temporary file if buf$="" then { class ref { f class: module ref (.f) { } } \\ make f closure by reference m->ref(false) =lambda$ m->{ if m=>f then exit r$=Key$ m=>f=r$="." =r$ } \\ exit function break } name$=tempname$ \\ we use Ansi type files Open name$ for output as F Print #F, buf$; Close #F Open name$ for input as #f class ref { f class: module ref (.f) { } } \\ make f closure by reference m->ref(f) =lambda$ m -> { if m=>f=-1000 then exit def r$ if not eof(#m=>f) then r$=Input$(#m=>f,2) =r$ if r$="" or r$="." then close #m=>f : m=>f=-1000 } } Module Odd(c$) { one$="" Module MyEven(c$, &last$) { one$=If$(last$=""->c$(), last$) if one$="" then exit if not one$ ~"[a-zA-Z]" Then last$=one$: exit \\ print before Print one$; out$<=one$ Call MyEven, c$, &last$ } Module MyOdd(c$, &last$) { one$=If$(last$=""->c$(), last$) if one$="" then exit if not one$ ~"[a-zA-Z]" Then last$=one$: exit Call MyOdd, c$, &last$ \\ print after Print one$; out$<=one$ } Do { one$="" Call MyEven, c$, &one$ if one$="" then exit Print one$; out$<=one$ one$="" Call MyOdd, c$, &one$ if one$="" then exit Print one$; out$<=one$ } Always Print out$<={ } } \\ Feeding keyboard keyboard "what,is,the;meaning,of:life." Odd PrepareStream$("") \\ Use a file for input Odd PrepareStream$("we,are;not,in,kansas;any,more.") clipboard out$ } Checkit