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.

RequestFile/IF script problem on AROS - help!

Last updated on 12 years ago
ChrisHChrisHSoftware Dev
Posted 12 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:

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
magoriumSoftware Dev
Posted 12 years ago
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 ?
ChrisHChrisHSoftware Dev
Posted 12 years ago
@magnorium
My mistake. RequestFile does indeed set WARN when cancelled. (I think) this solves my problem :)
M
magoriumSoftware Dev
Posted 12 years ago
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
ChrisHChrisHSoftware Dev
Posted 12 years ago

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
magoriumSoftware Dev
Posted 12 years ago

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:
ChrisHChrisHSoftware Dev
Posted 12 years ago
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 cannot 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.
Users who participated in discussion: magorium, ChrisH
Sign In
Not a member yet? Click here to register.
Forgot Password?
Users Online Now
Guests Online 10
Members Online 0

Total Members: 265
Newest Member: metaneutrons
Member Polls
Should AROSWorld continue with AROS-Exec files (SMF based)?
Yes44 %
44% [12 Votes]
No26 %
26% [7 Votes]
Not sure30 %
30% [8 Votes]