From: "Carlo Hogeveen"
-----Original Message-----
From: JOSE ADRIANO BALTIERI
To: tsepro@semware.com
Date: vrijdag 5 december 1997 19:21
Subject: UNDO/REDO MACRO
>
>Hi !
>
> I'm looking for a macro to UNDO/REDO what I have typed
>(something like Turbo Pascal ALT BACKSPACE).
>
> Have downloaded TSEUNDO9.ZIP by James Coffer but, this macro has
too
>much more than what I need. I'd like something simpler, just with the basic
>UNDO/REDO functionality.
>
> Does someone else know anything like this ?
>
>----
>Jose Adriano Baltieri
>Systems Analyst, Methodist University of Piracicaba, Brazil
>
Hi yourself!
Not being familiar with Turbo Pascal, I am guessing that
it's key does a REDO from any "normal"
character that is deleted (UNDO) with the key.
I have come up with a short macro that does that for the last 255 backspaced
characters.
Load and compile the following macro for example as "\tse\mac\altback.s",
and execute it after starting TSE or put it in your AutoLoadList as
"altback".
I started some ago time with a real (but still very simple) Undo/Redo,
but stopped for lack of time: I'll pick it up again.
Carlo
------------------------------------------------------------
string stack[255] = ""
proc stack_key(integer key_code)
if length(stack) == 255
stack = substr(stack, 2, 254)
endif
stack = stack + chr(key_code)
end
proc unstack_key()
integer key_code
if length(stack) > 0
key_code = asc(stack[length(stack)])
if key_code == 13
pushkey()
else
pushkey(key_code)
endif
stack = substr(stack, 1, length(stack) - 1)
endif
end
proc mbackspace()
if currpos() == 1
stack_key()
else
if currchar(currpos() - 1) in 12, 32 .. 254
stack_key(currchar(currpos() - 1))
endif
endif
if (not backspace()) and prevchar()
joinline()
endif
end
proc maltbackspace()
unstack_key()
end
proc main()
end
mbackspace()
maltbackspace()
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|