"Are You Sure?" message to confirm Exit in TSE 2.5 for DOS?

16 views
Skip to first unread message

Clueless in Seattle

unread,
Sep 2, 2012, 3:51:07 PM9/2/12
to SemWare TSE Pro text editor
I'm having trouble training myself to not type Alt+F+X when I want to
close a file.

So I end up inadvertently shutting TSE down entirely while I have a
bunch of files open, when all I wanted to do was close a single file.

Is there a configuration option that I could set so that TSE would
give me an "Are You Sure You Want to Shut Down TSE?" message?

Will in Seattle
a.k.a. "Clueless"



Larry

unread,
Sep 2, 2012, 5:34:41 PM9/2/12
to sem...@googlegroups.com
/***
These cursor key definitions will cause the cursor to act like NotePad at
the end and beginning of the cursor line.

You can create a macro called cursor.s with these two lines and compile
it. You can also add the definitions to your tse.ui file if you prefer.
To remove these key definitions, purge the macro.
***/

<cursorright> right() if currcol()>=currlinelen() if down() begline() else
endline() endif endif
<cursorleft> left() if currcol()==1 and up() endline() endif
<cursorup> up() if currcol()>=currlinelen() endline() endif
<cursordown> down() if currcol()>=currlinelen() endline() endif

Rick C. Hodgin

unread,
Sep 2, 2012, 5:43:39 PM9/2/12
to sem...@googlegroups.com, Clueless in Seattle
Yes. There is a way to set the default behavior of TSE when you exit
the last file. It can return to a menu, for example, before you exit.

It may honor the same settings as the empty command line option. If so:

Go to Options -> Full Configuration -> System / File Options -> Empty
Command-Line Action -> Set to "Menu".

If it's somewhere else, someone else will have to help me.

Best regards,
Rick C. Hodgin

Clueless in Seattle

unread,
Sep 2, 2012, 10:29:13 PM9/2/12
to SemWare TSE Pro text editor


On Sep 2, 2:43 pm, "Rick C. Hodgin" <foxmuldrs...@yahoo.com> wrote:
> Yes.  There is a way to set the default behavior of TSE when you exit
> the last file.  It can return to a menu, for example, before you exit.
>
> It may honor the same settings as the empty command line option. If so:
>
> Go to Options -> Full Configuration -> System / File Options -> Empty
> Command-Line Action -> Set to "Menu".

Hi Rick,

Thanks for responding to my query.

In my version of TSE 2.5 for DOS, I don't seem to have a "Menu"
option under "Empty Command-Line Action. Here's what I see:

Prompt
File Manager
Recent
Unnamed
PickList
Restore State

I have to confess that I haven't a clue what "Empty Command-Line
Action" means. But I am intrigued by the option named "File Manger."
I don't find "File Manager" in my TSE manual. I'm tempted to select
it just to see what it does.

Clueless in Seattle

unread,
Sep 2, 2012, 10:49:04 PM9/2/12
to SemWare TSE Pro text editor


On Sep 2, 2:34 pm, "Larry" <hayes_sm...@hotmail.com> wrote:

> These cursor key definitions will cause the cursor to act like NotePad at
> the end and beginning of the cursor line.

Man, Larry, you really know your stuff!

I just compiled and executed that macro and my cursor now behaves the
way I'm used to having it behave.

How long have you been at this game, anyway?

> You can create a macro called cursor.s with these two lines and compile
> it.

I counted four lines, instead of two. But it worked just fine for me
in four lines.

> <cursorright> right() if currcol()>=currlinelen() if down() begline() else
> endline() endif endif
> <cursorleft> left() if currcol()==1 and up() endline() endif
> <cursorup> up() if currcol()>=currlinelen() endline() endif
> <cursordown> down() if currcol()>=currlinelen() endline() endif


Thanks a million! From now on I'm going to refer to you as "The
Mozart of Macros."

Larry

unread,
Sep 3, 2012, 10:32:19 AM9/3/12
to sem...@googlegroups.com
/***
:) Mozart? No, I think not. HE knew what he was doing. :) Me? I just
muddle along and hope.

I guess I've been doing this since around 2002 or so. The folks here
have been very helpful and every now and then I see something to try.

Anyway, here is a more complete cursor movement macro that includes
other cursor movement keys. I seem to recall that you are using the
WordStar .ui file, so I set the assigned keys for cursor movement to it.
If your .ui is not WordStar, this is easily changed.

Also let me know if any of the keys do not work the way you expect. If
there are any other keys that might benefit from this macro, let me
know.

Just compile the macro and execute it to activate all the keys. Purge
the macro to return the key definitions to their original values.

I think you can add it to your AutoLoad list if it is useful.

By the way, you might look at the last two assigned keys. These are the
ones I use to QuitFile and Exit and they do help prevent keystroke
confusion. :)

***/

proc mcursor(integer i)

case i
when 1 // cursor right
if currcol()>currlinelen() if down() begline() else endline() endif
endif
when 2 // cursor left
if currcol()==1 and up() endline() endif
when 3 // cursor up
if currcol()>currlinelen() endline() endif
when 4 // cursor down
if currcol()>currlinelen() endline() endif
when 5 // other movements
if currcol()>currlinelen() endline() endif

endcase

end

// wordstar ui movement key assignments

<CursorLeft> Left() mcursor(2)
<Ctrl s> Left() mcursor(2)
<CursorRight> Right() mcursor(1)
<Ctrl d> Right() mcursor(1)
<CursorUp> Up() mcursor(3)
<Ctrl e> Up() mcursor(3)
<CursorDown> Down() mcursor(4)
<Ctrl x> Down() mcursor(4)

<Ctrl CursorUp> ScrollUp() mcursor(5)
<Ctrl w> ScrollUp() mcursor(5)
<Ctrl CursorDown> ScrollDown() mcursor(5)
<Ctrl z> ScrollDown() mcursor(5)

<PgUp> PageUp() mcursor(5)
<Ctrl r> PageUp() mcursor(5)
<PgDn> PageDown() mcursor(5)
<Ctrl c> PageDown() mcursor(5)

<Ctrl Home> BegWindow() mcursor(5)
<Ctrl q><e> BegWindow() mcursor(5)
<Ctrl End> EndWindow() mcursor(5)
<Ctrl q><x> EndWindow() mcursor(5)

<Ctrl q><i> GotoLine() mcursor(5)

// quitfile and exit keys

<ctrl backspace> quitfile()
<alt backspace> exit()

Clueless in Seattle

unread,
Sep 3, 2012, 12:27:52 PM9/3/12
to SemWare TSE Pro text editor
This thread has gotten tangled up with the other thread I started
about the same time:

"How to change cursor behavior in TSE 2.5 for DOS?"

http://groups.google.com/group/semware/browse_thread/thread/d3dc1d43d6706e3e

Would I be out-of-place if I were to ask that we try to untangle the
threads and get this one back on the original topic?

I don't want to appear ungrateful for the help Larry has provided in
modifying the cursor behavior in my antique version of TSE for DOS.
That's been a great boon to me.

But I'm still hoping to find a way to configure TSE so that it would
give me a warning when I mistakenly type Alt+F+X when I only mean to
close a single file:

S.E. Mitchell

unread,
Sep 4, 2012, 7:23:48 PM9/4/12
to sem...@googlegroups.com
One way would be to change the .ui file that you are using.

Instead of having Exit() assigned to [alt+f+x], assign QuitFile() to
that menu item.

Find the FileMenu() in the .ui file you are using (possibly tse.ui):
Then find the end of that menu:

"Sa&ve All" , SaveAllFiles()
"Save All && &Exit" , SaveAllAndExit()
"E&xit" , Exit()
end

Change the Exit() to QuitFile()

Then re-compile the .ui file, by selecting Macro, Compile.

Or maybe even assign another menu to "E&xit":

menu MyExit()
"Quit this file", QuitFile()
"Quit all files", Exit()
"Cancel"
end

And change the "Exit()" associated with "E&xit" to MyExit().

Anyway, just some ideas.

Clueless in Seattle

unread,
Sep 5, 2012, 12:20:05 PM9/5/12
to SemWare TSE Pro text editor


On Sep 4, 4:23 pm, "S.E. Mitchell" <sammy.mitch...@gmail.com> wrote:

> Or maybe even assign another menu to "E&xit":
>
> menu MyExit()
>     "Quit this file",   QuitFile()
>     "Quit all files",   Exit()
>     "Cancel"
> end

Bingo!

I bet that would work just fine!

I was originally hoping to find a configuration option that I could
just set and forget.

But a decade or so ago I *did* manage to create a macro that displays
a menu of commands. And I use that menu many times every day now that
I'm running TSE 2.5 for DOS again.

So I'm sure that if I look at that old macro it will jog my memory and
I can adapt it to give me a warning menu before TSE shuts itself down.

Thanks, Sammy, for taking the time to help me along on this!

Spamless in Seattle

unread,
Dec 6, 2013, 1:51:57 PM12/6/13
to sem...@googlegroups.com
This problem came back to bite me on the you-know-what this morning.

I had a whole bunch of different test files open all at once, to use to
test out a macro I've been working on for weeks.

I wanted to save a file and I meant to type Alt+F+S

But the third finger on my left hand slipped and I hit the "X" key
instead of the "S" key and *wham!* I lost the whole kit and caboodle.

I thought I had resolved this problem over a year ago, but it looks like
I may be missing a macro file in my autoload list.

Or maybe I never actually got around to taking care of this issue back then.

But either way, it looks like I'm going to have to tackle this problem
all over again.

Sheesh!

What I'm going to try to do is redefine the Alt+F+X to display a menu
that gives me a warning an the option to cancel the command.

John Kopp

unread,
Dec 6, 2013, 4:32:34 PM12/6/13
to sem...@googlegroups.com
Will,
Read the "HELP" for the "Exit" command on the File Menu (highlight the
command, then press F1). Assuming that you have not changed the way
this command works, if you had a changed file you would have seen a
prompt box showing "Save Changes?" with possible responses of "Yes",
"No", Or "Cancel". I would guess that you did press the "S" key before
your finger slipped to the "X" key and the changes to the file were saved.

John Kopp

Spamless in Seattle

unread,
Dec 7, 2013, 10:46:40 AM12/7/13
to sem...@googlegroups.com
On 12/6/2013 1:32 PM, John Kopp wrote:

> Read the "HELP" for the "Exit" command on the File Menu (highlight the
> command, then press F1). Assuming that you have not changed the way
> this command works, if you had a changed file you would have seen a
> prompt box showing "Save Changes?" with possible responses of "Yes",
> "No", Or "Cancel". I would guess that you did press the "S" key before
> your finger slipped to the "X" key and the changes to the file were saved.

You're probably right, John. Either that, or I just wasn't sure if I'd
saved a file and so tried to type Alt+F+s to be certain. At the time I
had a lot of files open all at once and was jumping back and forth
between them and making changes in many of them on the fly.

I don't think I ever did ever get around to trying to modify that
Alt+F+X way back when I first asked about it.

But I'd sure like to give it a try this time around.

I found an Ask() command in the macro manual for TSE 2.5 for DOS, but
the documentation is difficult for me to comprehend.

Do you think that Ask() would be a likely candidate for a keyboard macro
that could intercept the Alt+F+X command and "Ask" me if I really want
to completely shut down TSE?

Spamless in Seattle

unread,
Dec 7, 2013, 11:47:35 AM12/7/13
to sem...@googlegroups.com
On 12/7/2013 7:46 AM, Spamless in Seattle wrote:

> Do you think that Ask() would be a likely candidate for a keyboard macro
> that could intercept the Alt+F+X command and "Ask" me if I really want
> to completely shut down TSE?

I dug around in the Google Groups archive and found a message posted by
Sammy, back when I first broached this topic. I think this will be the
simplest way for me to idiot-proof my keyboard:

S.E.Mitchell
9/4/12
Re: [TSE] Re: "Are You Sure?" message to confirm Exit in TSE 2.5 for DOS?

John Kopp

unread,
Dec 9, 2013, 7:15:14 PM12/9/13
to sem...@googlegroups.com
Spamless in Seattle wrote:
> I don't think I ever did ever get around to trying to modify that
> Alt+F+X way back when I first asked about it.
>
> But I'd sure like to give it a try this time around.
>
> I found an Ask() command in the macro manual for TSE 2.5 for DOS, but
> the documentation is difficult for me to comprehend.¦proc mExit()
>
> Do you think that Ask() would be a likely candidate for a keyboard macro
> that could intercept the Alt+F+X command and "Ask" me if I really want
> to completely shut down TSE?
>
> Will in Seattle
> a.k.a. "Clueless"
>
Will,
Here is one implementation of a procedure to do this. Add this in the .UI
file before the FileMenu() and change Exit() to mExit() in the FileMenu().

John Kopp

*****BEGIN PROCEDURE*****
proc mExit()
if YesNo("Are you sure you want to EXIT TSE?") == 1
Exit()
endif
end
*****END PROCEDURE*****

Reply all
Reply to author
Forward
0 new messages