on *:start:{
.hmake amacros 100
if ($isfile(/amshdir(amsacros.hsh))) {
.hload amacros $amshdir(amsacros.hsh)
}
else {
/amsacros.start
.hsave -o amacros dat\hsh\amsacros.hsh
}
}
on *:EXIT: {
.hsave -o amacros dat\hsh\amsacros.hsh
.hfree amacros
}
on *:input: {
if ( $left($1,1) != / ) {
var %w = 1
var %text
var %acro = [<acronym>]
while ($gettok($1-, %w, 32) != $null) {
var %word = $v1
if ($hget(acronym, %word) != $null) var %text = %text $replace(%acro, <acronym>, $v1)
else var %text = %text %word
/inc %w
}
//echo -a %text
/halt
}
}
alias amshdir return (",$mircdirdat\hsh\,$1,")
alias amsacros.start {
.hadd amacros afk Away From Keyboard
.hadd amacros brb Be Right Back
.hadd amacros gtg Got To Go
.hadd amacros lol Laughing Out Loud
.hadd amacros ttyl Talk To You Later
}
dialog acro_test {
title "$amlogo ACRONYMS"
size -1 -1 314 200
option dbu
list 1, 16 64 82 107, size vsbar
edit "", 3, 16 46 82 10
edit "", 4, 147 46 150 10
list 2, 147 64 149 107, size vsbar
button "Add Acro", 5, 91 25 37 9
button "Del Acro", 6, 133 25 37 9
text "Input TexT", 7, 41 35 27 8
text "Output TexT", 8, 208 35 32 8
text "A", 9, 120 56 4 8
text "C", 10, 120 69 5 7
text "R", 11, 120 81 5 7
text "O", 12, 120 93 5 7
text "N", 13, 120 105 4 7
text "Y", 14, 120 117 4 8
text "M", 15, 120 129 5 8
text "S", 16, 120 141 4 8
button "Okay", 17, 104 186 37 12, ok
}
on *:dialog:acro_test:*:*: {
if ($devent == init) {
if !$hget(amacros) { hamke amacros 100 | hload amacros $amshdir(amsacros.hsh) }
var %x = 1
while $hget(amacros,%x).item {
did -a $dname 1 $v1
inc %x
}
var %y = 1
while $hget(amacros,%y).data {
did -a $dname 2 $v1
inc %y
}
}
}