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
AspireOS v.2.2 codename &qu...
in Development General
8852 6 nikos
01/03/2019 07:26
aros-exec no more.
in Site Feedback
3919 11 magorium
10/30/2018 20:39
DELL Latitude D520
in Hardware
5012 34 nikos
10/18/2018 11:57
Pfs3
in Development General
1888 1 cavemann
10/14/2018 17:50
Video Overlay
in Development General
2160 0 nikos
10/02/2018 08:34
USB game controllers
in General Chat
4291 29 nikos
09/30/2018 09:51
Cross/native compiling GCC ...
in General Chat
1824 5 jp48
09/30/2018 03:03
Top bar.
in Site Feedback
1454 6 cavemann
09/29/2018 17:03
hello
in Introductions
1402 1 nikos
09/26/2018 04:57
Putting AROSWorld.org for s...
in Public Announcements
13628 4 amigamia
09/24/2018 07:32
A week in AROS...
in Development General
38652 172 magorium
05/27/2017 23:49

RequestFile/IF script problem on AROS - help!

Last updated on 7 years ago
ChrisH
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:

SetEnv AnnPathReply ""
RequestFile TITLE "Where is Annotate located?" DRAWERSONLY >Env:AnnPathReply
IF "$AnnPathReply" EQ ""
   SKIP Quit
ENDIF
LAB Quit


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


If I have "Set echo on" enabled, then you can see why it gets confused:

Quote

IF ""Work:Chris/Annotate/"" EQ ""


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 ""


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 :-(
M
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".

That's strange, as our documentation state that it does.
Not that i don't believe you, but are you sure ?
ChrisH
@magnorium
My mistake. RequestFile does indeed set WARN when cancelled. (I think) this solves my problem :)
M
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:

REQUESTFILE >ram:blah Title etc.
IF WARN
  echo 'filename not returned'
ELSE
  echo 'filename was returned'
ENDIF
ChrisH

Quote

(I think) this solves my problem

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 ;)

If you want, I can just post on aros-exec ;)
M

Quote

Is there any easy way to identify whether a script is running on AROS or not?

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

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:
ChrisH
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

Sign In

Not a member yet? Click here to register.

Shoutbox

You must login to post a message.
No messages have been posted.


Powered by PHP-Fusion Copyright © 2019 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3.

Bootstrap Theme by PHP-Fusion Inc
3,233,129 unique visits | Memory used: 5.99MB/2MB