TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: Jorj Strumolo
from: Ted Menks
date: 1998-11-26 02:53:00
subject: executable extensions

Hi Jorj,

(Thursday November 19 1998 23:03) Jorj Strumolo to Ted Menks about:
executable extensions

 TM>> The executable extension doesn't NEED to know about
 >> any %1 parameters!  It's the associated program (together
 >> with 4Dos.com) that will deal with the parameters!
 JS>  But the program may be picky about the *placement* of those
 JS>  parameters.

That's easily solved by putting %1 etc in the correct spot in the alias.
That's why I mentioned aliases in the first place. Originally, this thread
was about a program that didn't allow the extension of the associated file
to be entered at the commandline.

 JS>   Consider this test extension:
 JS>  set .zaq=d:\bag\xx34e.com 40 150

 JS>  The program wants commands in a certain format:
 JS>  Usage: XX34E [d:path]filename [columns] [rows] [ADn]

 JS>  So this command works:               d:\bag\xx34e.com d:\incs.zaq 40 150
 JS>  But what the ExecExt produces is:    d:\bag\xx34e.com 40 150
 JS> d:\incs.zaq

Logical! The help already tells us, that the name of the
"executable" will be the last parameter. If you want it to be
somewhere else, you MUST use an alias!

 JS>  And XX34E can't handle the switches coming first, even though
 JS>  most programs want them there.  The '%1' bits try to handle the
 JS>  positioning.  But they don't work, either.

 JS>  set .zaq=d:\bag\xx34e.com %1 40 150
 JS>         produces                        .ZAQ=d:\bag\xx34e.com  40 150

Ah, that's the error! First, to get the %1 parameter in place, you may need
back-quotes (`) around the commandline (unless you read them from a file,
using set /r):

set .zaq=`d:\bag\xx34e.com %1 40 150`

At least that will show the %1 parameter in place.

However, it will still not WORK, because when ENTERING the .zaq-file as a
command, it isn't the first PARAMETER, but rather the COMMAND. Hence: not
parameter %1, but parameter %0.

But when the command has been expanded, %0 will no longer refer to the
.zaq-file but to d:\bag\xx34e.com. Thus, changing %1 to %0 will also fail.
Both parameters, regardless of % or %%, will fail, because the translation
(alias- and extension-expansion) both interfere with the process, changing
the order of the words in the commandline.

That's why I mentioned "aliases" like this:

alias xx34e=`*d:\bag\xx34e.com %1 40 150`
set .zaq=xx34e

(keep the * asterix in, to make sure 4Dos will not try to use the alias AGAIN)

Now let's suppose you have a file named example.zaq, and that's the name
you type at the commandline:

C:\path\> example.zaq 

4dos will translate the ExecExt (.zaq) as:

  xx34e example.zaq

(comment: You can see that example.zaq is now parameter %1)
then it will translate the alias (xx34e) as:

  d:\bag\xx34e.com example.zaq 40 150

And THAT is what you wanted to see happening!

 TM>> Then build an alias like this: alias pret=pret.exe %{at}name[%1]
 >> and an exec.extension like   : .pas=pret
 >> One way or another it should be able to work ;-)

 JS>  But it doesn't:

 D:\>> alias qax=d:\bag\xx34e.com %{at}name[%1] 40 50 ^ set .zaq=qax

Hey!!! Don't put them on ONE line... We might start to think that the
SET-command was part of the alias. Even 4Dos might be fooled into believing
so!

 D:\>> eset .zaq qax
 JS> .ZAQ=qax
 JS> qax=d:\bag\xx34e.com %{at}name[%1] 40 50

 D:\>> incs.zaq

 JS>         XX34E 0.2B(c)1992 Greg Vigneault
 JS>         Box 7169,Stn.A,Toronto,Canada M5W1X8

 JS>         ?Error: Filename

Does xx34e.com accept the filename without extension? If not, then you
shouldn't use the %{at}name[] function.

 JS>  All variations of %1, %%1, %0, %%0, and %name and %%name fail.

Of course! When used in the wrong context, ofcourse they fail! I didn't
mention aliases for FUN ;-)

 JS>  Did you actually try any of your suggestions?

I'm beyond trying, Jorj. I have set up tons of these ExecExt/Alias
combinations for different programs that do not work with standard
parameters. Those combinations _ALL_ work for me.
It's when you mis-interpret my suggestions, that things start going wrong.
The %{at}name[] function was meant for programs that do NOT allow the
extension to be entered at the commandline. The %1 parameter was meant for
use in an alias, so that one might alter the appearance or the order of
parameters.

I hope you don't feel as if I'm coming on too strong. I recognize you to be
one of the great minds in this conference, giving perfect answers to most
questions and offering good suggestions to all. But this time you've done
some really foolish things with my advise ;-)))

I would like to hear from you again, telling me whether or not it works as expected.

GreetZ,
    2:2449/236.51  PGPkey: 2048/1B2ACCED (by RRQ)
... If at first you don't succeed, have somebody else do it for you
--- 4Dos v6.01a ---
* Origin: It's the 4Dos way! (Teddy's Land +49-5971-14966 (2:2449/236.51)
SEEN-BY: 396/1 632/0 371 633/260 267 270 371 635/444 506 728 639/50 252
@PATH: 2449/236 200 150 24/888 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

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™.