Amiga DOS scripts .def and second Keyword

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Amiga DOS scripts .def and second Keyword

Post 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?
joerg
Posts: 371
Joined: Sat Mar 01, 2014 5:42 am

Re: Amiga DOS scripts .def and second Keyword

Post 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".
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: Amiga DOS scripts .def and second Keyword

Post 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
ExecSG Team Lead
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Re: Amiga DOS scripts .def and second Keyword

Post 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..
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Re: Amiga DOS scripts .def and second Keyword

Post 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.. :-(
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: Amiga DOS scripts .def and second Keyword

Post 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
ExecSG Team Lead
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: Amiga DOS scripts .def and second Keyword

Post 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.
User avatar
gazelle
Posts: 102
Joined: Sun Mar 04, 2012 12:49 pm
Location: Frohnleiten, Austria

Re: Amiga DOS scripts .def and second Keyword

Post 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:>
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Re: Amiga DOS scripts .def and second Keyword

Post 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.
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: Amiga DOS scripts .def and second Keyword

Post 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?
ExecSG Team Lead
Post Reply