Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

Latest Active Forum Threads

  Thread Views Replies Last Post
Happy New Year Everyone!!
in Public Announcements
331 5 enzorug
01/12/2020 20:15
New Version of PortablE?
in PortablE
8126 24 amigamia
01/03/2020 14:43
AspireOS v.2.2 codename "Obitus"
in Development General
9439 6 nikos
01/03/2019 07:26
aros-exec no more.
in Site Feedback
4909 11 magorium
10/30/2018 20:39
DELL Latitude D520
in Hardware
6456 34 nikos
10/18/2018 11:57
in Development General
2534 1 cavemann
10/14/2018 17:50
Video Overlay
in Development General
2593 0 nikos
10/02/2018 08:34

RequestFile/IF script problem on AROS - help!

Last updated on 7 years ago
I'm trying to get a simple AmigaDOS script to work on AROS, and have run into a problem which I can't solve. Here is basically what I am doing:

[code]SetEnv AnnPathReply ""
RequestFile TITLE "Where is Annotate located?" DRAWERSONLY >Env:AnnPathReply
IF "$AnnPathReply" EQ ""
LAB Quit[/code]

On AmigaOS4 this works as expected, but on AROS the "IF" command gets very confused by the fact that the AnnPathReply already contains quote marks, and so gives this error message:
[quote]If: wrong number of arguments[/quote]

If I have "Set echo on" enabled, then you can see why it gets confused:
[quote]IF ""Work:Chris/Annotate/"" EQ ""[/quote]

Please do NOT suggest that I remove my quotes around $AnnPathReply, because when I cancel RequestFile the IF line would fail because it'd look like this:
[quote]IF EQ ""[/quote]

Also note that RequestFile does NOT return an error code when cancelled (not on OS4 either), so I can't use "IF WARN".

I'm kinda shocked that using RequestFile in a script isn't possible on AROS. Hasn't anyone else run into this problem? Or is there some other solution I overlooked? As it currently stands I can't write a simple installer script that works on AROS :-(
Hi Chris

[quote]Also note that RequestFile does NOT return an error code when cancelled (not on OS4 either), so I can't use "IF WARN".[/quote]
That's strange, as [url=http://aros.sourceforge.net/documentation/users/shell/requestfile.php]our documentation[/url] state that it does.
Not that i don't believe you, but are you sure ?
My mistake. RequestFile does indeed set WARN when cancelled. (I think) this solves my problem :)
Nice, such a dual question on multiple forums ;)

Good that it does, as that means the documentation is not lacking :)

If it doesn't solve the problem then please post script again :D.

I f believe it's something like:

[code]REQUESTFILE >ram:blah Title etc.
echo 'filename not returned'
echo 'filename was returned'
[quote](I think) this solves my problem[/quote]
Damn. No it doesn't, because now the script doesn't work on OS4 (and perhaps not MOS either - can't test at the moment).

I need to choose different (script) code for AROS vs not. Is there any easy way to identify whether a script is running on AROS or not?

[quote] Nice, such a dual question on multiple forums ;)[/quote]
If you want, I can just post on aros-exec ;)
[quote]Is there any easy way to identify whether a script is running on AROS or not?[/quote]
Shall i post a different solution here ? ;) nah, use the ABI environment variable. afaik it is aros specific.

[quote]If you want, I can just post on aros-exec[/quote]
Uhm... please don't .. i will repeat my answers if there aren't coming any better ones @ ae :-)

BTW: should there be an OS environment variable. Even winblows has it. Oops, you could make such thing yourself in the startup-sequence or user-startup :hint:
As I said on the 'other' forum... Thanks for the ABI env suggestion: It works :)
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.
Moderator: Administrator

Blog Archive

No Blogs has been posted yet

Sign In

Not a member yet? Click here to register.

Users Online Now

Guests Online 3

Members Online 0

Total Members: 155
Newest Member: enzorug
Memory used: 5.45MB/2MB