Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
46 user(s) are online (42 user(s) are browsing Forums)

Members: 0
Guests: 46

more...

Support us!

Headlines

 
  Register To Post  

Arexx question - getting user responses from REQUESTFILE, REQUESTSTRING [Solved]
Not too shy to talk
Not too shy to talk


See User information
Hi,

I am trying to put together an arexx script with no luck. I want to use REQUESTSTRING and REQUESTFILE to ask the user for input. However, I'm having trouble getting the result into a variable.

Here's what I've got:

/* Download URL */

OPTIONS RESULTS
address command 

'c:requeststring title "URL Downloader" body "Enter URL to download" to t:dlurl'
dlurl result

'c:requestfile savemode title "Enter download filename" noicons >nil:'
dlfile result


But it doesn't do anything, the two variables just read as RESULT.

Can anyone point me in the right direction?

Thank-you.


Edited by daveyw on 2019/12/15 19:08:14
Go to top
Re: Arexx question
Just popping in
Just popping in


See User information
@daveyw

I'm not at home and can't check if this works, but what is the result if you define the variable like this :

dlurl 'c:requeststring title "URL Downloader" body "Enter URL to download" to t:dlurl'
dlfile 'c:requestfile savemode title "Enter download filename" noicons >nil:'


Regards,
Petrol

Go to top
Re: Arexx question
Not too shy to talk
Not too shy to talk


See User information
Hi DaveyW,

While I know there are shorterhand ways of doing this, the
longhand way always worked for me...

/* Ask User Choice & Print Out
*/
TitleBarTxt = 'Test Requester'
BodyTxt = 'Pick something!'
ButtonsTxt = '"Yes" "Umm" "No"'
ReqType = 'INFO'
cline = 'c:requestchoice "' || (TitleBarTxt) || '" "' || BodyTxt || '" ' || (ButtonsTxt) || ' TYPE ' || (ReqType) || ' TO T:response.txt'
address command cline
MyReturnCode = RC
if exists('T:response.txt') then
if open(ReqF,'T:response.txt','r') then do
pick = strip(readln(ReqF),'B','"')
bs = close(ReqF)
address command 'c:delete T:response.txt'
say 'response >' pick '<'
end
else
say 'Couldn''t open Requester output file'

Fundamentally, you've have to read the output file from the
Req... command.

Good luck,

PJS

Go to top
Re: Arexx question
Just can't stay away
Just can't stay away


See User information
@daveyw

Here's solutions I found in an ARexx guide:

OPTIONS RESULTS
ADDRESS COMMAND
rxset reqres '`requeststring title "URL Downloader" body "Enter URL to download"`'
myresult=getclip(reqres)
call setclip(reqres,'')
say myresult

rxset reqres '`c:requestfile SAVEMODE NOICONS TITLE "Enter download filename"`'
myresult=getclip(reqres)
call setclip(reqres,'')
say myresult

NOTE:
rxset is an external arexx utility in C: (Included in the OS)
The scripts contain backward quotes produced by the keyboard key below "Esc". They are easily confused with the single quote.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: Arexx question
Not too shy to talk
Not too shy to talk


See User information
@xenic

Thanks xenic, that did the trick.

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