Page 1 of 1

Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 2:15 pm
by Amigo1
could someone please try this script.
The second Keyword (File2) is not read from the CLI and .DEF does not what it should.
What am I doing wrong?

Code: Select all

.KEY FILE1/A, FILE2
.BRA {
.KET }
.DEF FILE2 "SomeTestString"
ECHO "{FILE1} is file 1 and {FILE2} is standard for File 2"
QUIT

the results are the following here:

7.AmigaOS:> execute ram:test-script RAM:
RAM: is File 1 and is standard for File 2


it should be
RAM: is File 1 and SomeTestString is standard for File 2

7.AmigaOS:> execute ram:test-script RAM: Data:
RAM: is File 1 and is standard for File 2


and here it should be
RAM: is File 1 and Data: is standard for File 2

On the other hand this works partially

Code: Select all

.KEY FILE1/A, FILE2
.BRA {
.KET }
ECHO "{FILE1} is file 1 and {FILE2$Blabla} is standard for File 2"
QUIT
while if inserting a third argument like this

Code: Select all

.KEY FILE1/A, FILE2, FILE3
.BRA {
.KET }
.DEF FILE2 "SomeTestString"
ECHO "{FILE1} is file 1 and {FILE2} is standard for File 2, while {FILE3$blablabla}"
QUIT
I get the following error:
EXECUTE: Parameters unsuitable for key "FILE1/A,".

What am I doing wrong?

Re: Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 3:10 pm
by joerg
Amigo1 wrote:could someone please try this script.
The second Keyword (File2) is not read from the CLI and .DEF does not what it should.
What am I doing wrong?
Remove the space(s) in .KEY, for the first example use ".KEY FILE1/A,FILE2", for the last one ".KEY FILE1/A,FILE2,FILE3".

Re: Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 3:51 pm
by ssolie
Amigo1 wrote:What am I doing wrong?
The .KEY dot command is documented here:
http://wiki.amigaos.net/index.php/Amiga ... t_Commands

Re: Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 5:29 pm
by Amigo1
joerg wrote:
Amigo1 wrote:could someone please try this script.
The second Keyword (File2) is not read from the CLI and .DEF does not what it should.
What am I doing wrong?
Remove the space(s) in .KEY, for the first example use ".KEY FILE1/A,FILE2", for the last one ".KEY FILE1/A,FILE2,FILE3".

Ok, thank you that slipped my view.. But .DEF still does not work. It doesn't pass the default value..

Re: Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 5:33 pm
by Amigo1
ssolie wrote:
Amigo1 wrote:What am I doing wrong?
The .KEY dot command is documented here:
http://wiki.amigaos.net/index.php/Amiga ... t_Commands
I didn't see the space, in fact instead of consulting the online documentation, I read the old 3.1 AmigaDOS manual which doesn't mention not to use spaces.

Still the .DEF command does not work here it does not pass the default value.. :-(

Re: Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 5:43 pm
by ssolie
Amigo1 wrote:...I read the old 3.1 AmigaDOS manual which doesn't mention not to use spaces.
The wiki should contain the newest and most up to date information available. You can even produce a paper manual from the wiki using the print/export features and have it professionally bound.
Still the .DEF command does not work here it does not pass the default value.. :-(
Be sure to review the .DEF documentation here:
http://wiki.amigaos.net/index.php/Amiga ... s#Defaults

Re: Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 5:48 pm
by chris
Amigo1 wrote:
ssolie wrote:The .KEY dot command is documented here:
http://wiki.amigaos.net/index.php/Amiga ... t_Commands
I didn't see the space, in fact instead of consulting the online documentation, I read the old 3.1 AmigaDOS manual which doesn't mention not to use spaces.
AFAIK that's a ReadArgs bug/feature, although it doesn't seem to be mentioned in the ReadArgs AutoDoc either.

Re: Amiga DOS scripts .def and second Keyword

Posted: Thu Mar 13, 2014 6:50 pm
by gazelle
Amigo1 wrote:Ok, thank you that slipped my view.. But .DEF still does not work. It doesn't pass the default value..
It does for me:

Code: Select all

.KEY FILE1/A,FILE2
.BRA {
.KET }
.DEF FILE2 "SomeTestString"
ECHO "FILE1 = *"{FILE1}*" and FILE2 = *"{FILE2}*""
QUIT

Code: Select all

7.RAM Disk:> Execute test ram:
FILE1 = "ram:" and FILE2 = "SomeTestString"

7.RAM Disk:> Execute test ram: test
FILE1 = "ram:" and FILE2 = "test"

7.RAM Disk:>

Re: Amiga DOS scripts .def and second Keyword

Posted: Fri Mar 14, 2014 1:15 pm
by Amigo1
gazelle wrote:
Amigo1 wrote:Ok, thank you that slipped my view.. But .DEF still does not work. It doesn't pass the default value..
It does for me:

Code: Select all

.KEY FILE1/A,FILE2
.BRA {
.KET }
.DEF FILE2 "SomeTestString"
ECHO "FILE1 = *"{FILE1}*" and FILE2 = *"{FILE2}*""
QUIT

Code: Select all

7.RAM Disk:> Execute test ram:
FILE1 = "ram:" and FILE2 = "SomeTestString"

7.RAM Disk:> Execute test ram: test
FILE1 = "ram:" and FILE2 = "test"

7.RAM Disk:>
Well, I don't know what to tell, but today it works.I typed in your test script and it did what it should. I tried the unmodified script I wrote yesterday and it works too.
AFAIR I did some soft and hard reboots yesterday because of some quirks, and tried it after the reboot too. So I really don't know why it wasn't working.
This really drives me crazy.
Is there anything I can do to catch such a situation to pass it to you guys and improve the system?

I'll check the RAM of the A1..

@ssolie
Thank you both for taking the time to answer.

Re: Amiga DOS scripts .def and second Keyword

Posted: Fri Mar 14, 2014 4:20 pm
by ssolie
Amigo1 wrote:Is there anything I can do to catch such a situation to pass it to you guys and improve the system?
There is no bug here that I can see. Perhaps you have some suggestions to help improve the documentation on the wiki?