TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: `CARLO HOGEVEEN`
date: 1997-12-06 10:46:00
subject: Re: UNDO/REDO MACRO

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.