[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cc65 compile for Apple 2e?



"John B. Matthews" <nospam@nospam.invalid> wrote in message 
nospam-6CB84D.20182417082008@aioe.org">news:nospam-6CB84D.20182417082008@aioe.org...

> Thanks! Is that the usual DOS idiom for "as many parameters as are sent?" 
> Would "%1 %2 %3 %4" be OK for up to four?

Yes. And all that a windows user needs to do to find out more is type help 
at the cmd prompt. This convention has been in use for as long as I 
remember. Which isn't saying much since my memory fades fast these days:) 
and since you are not a windows user you'll just have to take my word on it 
<g> or I'll need to eat more fish.

>Do you know a DOS equivalent to bash "${@}", in effect meaning "all 
>parameters, quoted."

There is NO globbing as such like in bash or ksh or sh or perl that I am 
aware-of... to me batch file syntax is a hybrid like a cross between the old 
CP/M SUBMIT and GWBASIC and other stuff Gates worked on. There is syntax 
like cut uses and the notion of fields and so forth and pipes and 
redirection and all that but the notion of a argument array isn't quite 
there to my knowledge... however a SHIFT keyword does exist ... and 
redirection from a filelist is supported.

Here's a little snippet that provides equivalent output for the first 10 
args, arg0 being the filename similar to what we are all familiar with, and 
there is no such thing as %10 or %11 etc... (you'll note the immediate 
variable %%i is accepted in the set of args, and if you were to run the 
thing it just lists each of the args on a new line in both examples)...

@echo off
REM the cmd interpreter has only 10 args available
REM however if the shift command is used it has more

for %%i in (%0 %1 %2 %3 %4 %5 %6 %7 %8 %9) do echo %%i

:BEGIN
if [%0] == [] goto END
echo %0
SHIFT /0
goto BEGIN
:END

Despite its limitations cmd can pretty-much be counted-on to be available to 
all Windows users.

Bill