version star-two-c source code → viewtopic.php?p=406242#p406242 ← click this link
version star-one-b source code → viewtopic.php?p=404344#p404344 ← click this link
version star-zero-c source code → viewtopic.php?p=402780#p402780 ← click this link
version planet-seven-h source code → viewtopic.php?p=393548#p393548 ← click this link
version planet-six-a source code → viewtopic.php?p=387767#p387767 ← click this link
version planet-five-b source code → viewtopic.php?p=385997#p385997 ← click this link
version planet-four-b source code → viewtopic.php?p=380555#p380555 ← click this link
version planet-three source code → viewtopic.php?p=377197#p377197 ← click this link
version planet-two-a source code → viewtopic.php?p=376270#p376270 ← click this link
version planet-one source code → viewtopic.php?p=375412#p375412 ← click this link
version planet-zero (this post)
Code: Select all
; i call this: the text filter
; this is a handy little program which is
; quite useful to me. and i hope it makes
; sense to others as well.
;
; In order to grasp what it can achieve,
; try these:
; Filter: oo{Enter}
; Filter: the{Enter}
; {Esc}
; Filter: -w{Enter}
; Filter: on{Enter}
; {Esc}
; {Esc}
; {Esc}
; Filter: oo -w on{Enter}
; {Esc}
; Filter: the oo{Enter}
; {Esc}
; Filter: as.*as{Enter}
; Filter: [Aa]nd{Enter}
; {Esc}
; {Esc}
; Filter: [Aa]nd -as.*as{Enter}
; If you've observed the changes in every
; step, you probably know how by now.
; Cheers.
gosub, init
theGui:
gui, destroy
gui, font, s18 bold, arial new
gui, add, text,, Filter:
w := a_screenwidth - 220
gui, add, edit, w%w% vNeedle%n% ym, % Needle%n%
gui, add, button, h38 default ym, Go
h := a_screenheight - 140, w := a_screenwidth - 50
gui, add, edit, readonly x20 h%h% w%w% hscroll vscroll, % Haystack%n%
gui, show
return
buttongo:
gui, submit
theNeedle := Needle%n%
r := "m`a)^(?!"
loop, parse, theNeedle, % a_space
if substr(a_loopfield,1,1) = "-"
r .= "(?!.*" substr(a_loopfield,2) ")"
else
r .= "(?=.*" a_loopfield ")"
r .= ").*\R?"
theHaystack := regexreplace(Haystack%n%,r)
n += 1
Haystack%n% := theHaystack, Needle%n% := theNeedle
goto theGui
guicancel:
guiclose:
guiescape:
n -= 1
if n
goto theGui
else
exitapp
init:
theHaystack=
(
The Road Not Taken
BY ROBERT FROST
Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,
And both that morning equally lay
In leaves no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.
I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I—
I took the one less traveled by,
And that has made all the difference.
)
n = 1
Haystack%n% := theHaystack
return