Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
81 user(s) are online (67 user(s) are browsing Forums)

Members: 1
Guests: 80

ktadd, more...

Support us!

Headlines

 
  Register To Post  

AmigaDos scripts OS4 [solved]
Quite a regular
Quite a regular


See User information
Hello,
can someone please try out this script:
Quote:

.key FILE
.bra {
.ket }

set echo on
echo "{file}"
SETENV ARGUMENT "{FILE}"
echo "$argument"
getenv argument
dir "{FILE}"
dir $argument
dir "$argument"
set echo off


the problem is, that the latter "DIR" command does not work.
In some kind of weird way, here I get a lot of spaces added to the
argument.
So "work:" becomes "work: " hence DIR or whatever command
will not work.

But on the third last line the script will fail if
a dir like "ram Disk:Rename Me" is given.

AFAI can tell, SETENV adds the unwanted spaces.


So I can think of a workaround for this, but my question is more: is there a general error on how
I'm using the variables or is it a bug?

thx

(the same script works with os3.9)
OS4+2007-07update


Edited by Amigo1 on 2007/9/17 21:28:10
Go to top
Re: AmigaDos scripts OS4 [solved]
Just popping in
Just popping in


See User information
@Amigo1

Quote:

Amigo1 wrote:
Hello,
can someone please try out this script:
Quote:

.key FILE
.bra {
.ket }

set echo on
echo "{file}"
SETENV ARGUMENT "{FILE}"
echo "$argument"
getenv argument
dir "{FILE}"
dir $argument
dir "$argument"
set echo off

the problem is, that the latter "DIR" command does not work.

I just did a clean install with OS4 final and it's 2007 July update on my A1XE.

In my tests, using the argument ram:, they all work.

Quote:

In some kind of weird way, here I get a lot of spaces added to the
argument.
So "work:" becomes "work: " hence DIR or whatever command
will not work.

There is no space added in my tests. I can only suggest you check your script to make sure you did not inadvertantly add a space or tab.

Quote:

But on the third last line the script will fail if
a dir like "ram Disk:Rename Me" is given.

Yes. The quotes are not passed on so that line sends what looks like an argument to the dir command resulting in an error.

example:
>dir ram disk:
DIR: wrong number of arguments

Quote:

AFAI can tell, SETENV adds the unwanted spaces.

Again, I do not find this.

Go to top
Re: AmigaDos scripts OS4 [solved]
Quite a regular
Quite a regular


See User information
@goody

The problem is solved, it was my fault, there was a space at the end of this line

Quote:

SETENV ARGUMENT "{FILE}"


the second strange thing is, that many spaces get added albeit there is only one space (and nothing else) after the quotes.

in the example you couldn't see that work: became work:
(with many spaces after and not one).

but since the problem is solved...

anyway, thanx for the reply.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project