Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
103 user(s) are online (51 user(s) are browsing Forums)

Members: 0
Guests: 103

more...

Headlines

 
  Register To Post  

(1) 2 »
YAM arexx port
Just can't stay away
Just can't stay away


See User information
What is wrong with this ?
5.OS4.1FE:> RX "address YAM; setmailfile 'Stock:Internet/YAM_2.10/Folders/SJ7A2AAFF7A=.001' "
1 *-* setmailfile 'Stock:Internet/YAM_2.10/Folders/SJ7A2AAFF...
+++ Command returned 10


Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@JosDuchIt

http://yam.ch/wiki/Documentation/ARexxAPI/SETMAILFILE

Don't supply a path, it is just stripped. The mail with the given filename is expected to be in the current folder and is set as current there (if I understand it correctly).

Best regards,

Niels

Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@nbache
Thanks for looking at it

in fact my path was incomplete, but i still have the same error code.
Using only the file name (and verifying the current folder indeed is "Ermias")
I have this.
15.OS4.1FE:> RX "address YAM; setmailfile 'Stock:Internet/YAM_2.10/Folders/Ermias/SJ7A2AAFF7A=.001,R' " 
  
*-* setmailfile 'Stock:Internet/YAM_2.10/Folders/Ermias/SJ...
+++ Command returned 10
15.OS4.1FE:> RX "address YAM; setmailfile '
SJ7A2AAFF7A=.001,R' " 
  1 *-* setmailfile '
SJ7A2AAFF7A=.001,R';
+++ Command returned 10


In fact i was reanimating an old script (YAM2.4) that did not work any more with YAM2.10
I was suspicious of the "=" now appearing in the file names, but that should be taken care of with the single quotes in the command, isn't it?

Could you check if setmailfile is working for you?


Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
I was able to make the setmailfile command work via the Gui4Cli sendrexx command.
It does not work for me however with the RX command or in a arexx script.


Go to top
YAM arexx port, one more problem
Just can't stay away
Just can't stay away


See User information
The following code

/* _MailInfo.yam - YAM/Gui4CLI interface                     */


OPTIONS RESULTS
ADDRESS YAM
Mailinfo STEM mi
.
ADDRESS COMMAND
SetEnv 
'.YmMsg.Idx' mi.INDEX
SetEnv 
'.YmMsg.Sts' mi.STATUS
SetEnv 
'.YmMsg.Frm' mi.FROM
SetEnv 
'.YmMsg.To' mi.TO
SetEnv 
'.YmMsg.RTo' mi.REPLYTO
SetEnv 
'.YmMsg.CC' mi.CC
SetEnv 
'.YmMsg.BCC' mi.BCC
SetEnv 
'.YmMsg.RstTo' mi.RESENTTO
SetEnv 
'.YmMsg.Sbj' mi.SUBJECT
SetEnv 
'.YmMsg.Nme' mi.FILENAME
SetEnv 
'.YmMsg.Sze' mi.SIZE
SetEnv 
'.YmMsg.Dte' mi.DATE
SetEnv 
'.YmMsg.Flg' mi.FMAGS
SetEnv 
'.YmMsg.MId' mi.MSGID


gives the results

16.Stock:Internet/YAM_2.10/Rexx> Rx "_MessageInfo_.yam"
SETENV: unable to open redirection file
10 *-* SetEnv '.YmMsg.Frm' mi.FROM;
+++ Command returned 10
SETENV: unable to open redirection file
11 *-* SetEnv '.YmMsg.To' mi.TO;
+++ Command returned 10
SETENV: unable to open redirection file
12 *-* SetEnv '.YmMsg.RTo' mi.REPLYTO;
+++ Command returned 10
SETENV: unable to open redirection file
21 *-* SetEnv '.YmMsg.MId' mi.MSGID;
+++ Command returned 10

the environment variables not mentioned in the error message are set correctly.

I guess at least this could be a bug, or??

Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@JosDuchIt
I got it to work in a script like this:

/* ARexx script */
ADDRESS YAM
SETFOLDER Storage
SETMAILFILE '"NTwafgAF7bg=.001,R"'

I had to set the folder before setting the file.
Notice the ' and the " surrounding the file name.

It doesn't work in a one-line script but I think that's more of an ARexx issue than a YAM issue. There doesn't seem to be any way to ESCAPE the double quotes in a one-line ARexx script but maybe an ARexx expert knows how to do it.

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

Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@xenic
thnaks , one problem solved

Go to top
Re: YAM arexx port
Quite a regular
Quite a regular


See User information
@xenic & @JosDuchIt

Variable = "A double-quote looks like """
SAY Variable

Should output:

A double-quote looks like "

So you should be able do this in shell:

RX "SAY 'A double-quote looks like ""'"

So, if double-quotes are needed, try this:

RX "ADDRESS YAM;SETFOLDER 'Storage';SETMAILFILE '""NTwafgAF7bg=.001,R""'"

I don't know if quotes are needed around the folder name, but I put them there because usually without them, it'd treat the word Storage as a variable. I also didn't see SETFOLDER used on a single-line example, so perhaps you could try with 'NTwafgAF7bg=.001,R' after setting the folder.

Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@MickJT
Yes. That worked. My biggest problem with ARexx has always been how and where to put the quotes.

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

Go to top
Re: YAM arexx port
Quite a regular
Quite a regular


See User information
@xenic

The rule is that for whatever type of quote you start with, if you want to use that same type of quote inside the variable itself, then you escape it with itself.

Like with Var = 'Doesn''t'. It's easier to use Var = "Doesn't"

Or you can use d2c(number) as well if that's easier to understand. Var = 'Doesn'd2c(39)'t'

Go to top
Re: YAM arexx port
Home away from home
Home away from home


See User information
@xenic

For maximum clarity rather than

/* ARexx script */
ADDRESS YAM
SETFOLDER Storage
SETMAILFILE '"NTwafgAF7bg=.001,R"'

do

/* ARexx script */
ADDRESS YAM
'SETFOLDER Storage'
'SETMAILFILE "NTwafgAF7bg=.001,R"'

Notice the single quotes are round the entire command, this mnake is much easier to remeber that ARExx commands are entire strings sent to the function host.

It also prevents accidental variable substitution

eg

SETMAILFILE = "woops"

before the command

would scupper yours but not mine.


Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
In a previous post i was wondering if there was a bug in YAM's arexx port.

The posted code (and errors reported) did point me to the source of the errors
after you address YAM and do a
'Mailinfo STEM' mi.

you get an error for any address info (mi.from, mi.to , mi.resentto, ...)
when you send the DOS command
'SetEnv .Yfrom' mi.from
=> "Unable to open redirection file"
this is because mi.from is a string containing sharp brackets ( eg Sender Jo <senderjo@telenet.be>)

I did not succeed in "quoting" the string to make SetEnv accept the string.
Can this be done?

I used a function


repbraces:
a = arg(1)
n = pos("<",a)

s = delstr(a,n,1)
s = insert("[",s,n-1,1)
n = pos(">",s)
s = delstr(s,n,1)
s = insert("]",s,n-1,1)
return s

to transform the brackets to square brackets.

Maybe there is a neater way?




Edited by JosDuchIt on 2016/10/20 19:35:30
Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@JosDuchIt

Quote:
you get an error for any address info (mi.from, mi.to , mi.resentto, ...)
when you send the DOS command
'SetEnv .Yfrom' mi.from
=> "Unable to open redirection file"
this is because mi.from is a string containing sharp brackets ( eg Sender Jo <senderjo@telenet.be>)
I would have thought something like:

'SetEnv .Yfrom "' || mi.from || '"'

- would do it? (I haven't tried it, though.)

But just in case, I'd probably remove the dot in front of the env var name.

Best regards,

Niels

Go to top
Re: YAM arexx port
Quite a regular
Quite a regular


See User information
@JosDuchIt

Var = Translate("Example <example@example.com>","[]","<>")

You could also try:

'SetEnv .Yfrom' "'mi.from'"
or
'SetEnv .Yfrom "'mi.from'"'

Or broadblues suggestion will work too.


Edited by MickJT on 2016/10/22 7:10:24
Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@,bache
@MickJT
Thanks
all three Setenv examples work

I lost much time trying to verify with "echo $envar" if the env variables were set..instead of using getenv. :(



Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
I encounterd an other problem with the ADDRINFO arexx command
An example script is given here http://yam.ch/wiki/Documentation/ARexxAPI/ADDRINFO
The exapmle does not work for me (after changing the ALIAS to 'Liesl' which is an existing entry in my .addressbook file

I completed the script as below and noted the resulting trace for the different ADDRINFO lines i used.
Not one is working including the origial (edited line)
Is this only here?


/* _AddrInfo.yam Test of 
ADDRINFO VAR/K,STEM/K,ALIAS/A
*/
OPTIONS RESULTS

/* Ignore possible error from ADDRINFO */
OPTIONS FAILAT 11

/*PARSE ARG HALIAS*/
ADDRESS YAM
ADDRLOAD 
'YAM:.addressbook' OPEN
"Liesl"
/* Find a given entry */
/* ADDRGOTO 'Liesl' // added noeffect */

/*ADDRINFO 'mars' STEM st. // original example */
ADDRINFO 'Liesl' STEM st/* "ADDRINFO Liesl STEM ST." nok*/
/* ADDRINFO "Liesl" STEM st.  // "ADDRINFO Liesl STEM ST." nok*/

/*'ADDRINFO "'n'"'  STEM st. //  "ADDRINFO "Liesl" STEM ST." nok*/
/* 'ADDRINFO ' || n   STEM st. // "ADDRINFO Liesl STEM ST." */
'"'n'"'
say n
 
/*'ADDRINFO ' || n   STEM s //"ADDRINFO "Liesl" STEM ST."*/


/* Only continue if RC == 0 */
SAY 'RC is' RC
IF RC ~= 0 THEN EXIT

/* List results */
SAY 'Type of entry: 'st.type /* ST.TYPE */
SAY 'Real name:     'st.name
SAY 
'Email address: 'st.email
SAY 
'PGP key ID:    'st.pgp
SAY 
'Homepage:      'st.homepage
SAY 
'Street:        'st.street
SAY 
'City:          'st.city
SAY 
'Country:       'st.country
SAY 
'Phone #:       'st.phone
SAY 
'Description:   'st.comment
SAY 
'Date of birth: 'st.birthdate
SAY 
'Portrait:      'st.image




Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@JosDuchIt

or just with "if set myvar...". Help on the If command says:

SET <variable> True if the environment variable is set (i.e.
if it exists).

Philippe 'Elwood' FERRUCCI
Sam460ex 1.10 Ghz
http://elwoodb.free.fr
Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@Elwood
Thanks that is a usefull reminder
i am not not sure however on what post you are replying,
i guess the latest and this is a suggestion to replace
the

IF RC ~= 0 THEN EXIT
line.


This is not the problem right now; Did you note i was not longer testing the MAILINFO or SETMAILFILE : i can use both of them now.
This is not the case with ADDRINFO.

This command has as template
ADDRINFO VAR/K,STEM/K,ALIAS/A
and whatever i try it fails. (see all alternative used in the latest script and the given reference script http://yam.ch/wiki/Documentation/ARexxAPI/ADDRINFO

from which it was derived.
In fact i think since we have the command ADDRGOTO ALIAS/A

a simpler command
ADDR_INFO VAR/K,STEM/K,
might do.

Before reporting my problems as a bug or suggesting this simpler command to the YAM authors i want to be sure others observe the same difficulty with the ADDRINFO command.

Can you/anybody check this?


Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@JosDuchIt
I copied the example at http://yam.ch/wiki/Documentation/ARexxAPI/ADDRINFO and added "ADDRESS YAM" below the "OPTIONS FAILAT 11" line. I changed the name in the ADDRINFO line and ran the script from a shell. It worked and printed the available information. However, I'm still using YAM 2.7 which may not help if you're using a more recent version of YAM.

It might be helpful if someone using the latest YAM release could test the example script for you.

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

Go to top
Re: YAM arexx port
Just can't stay away
Just can't stay away


See User information
@xenic

I teted ot on YAM 2.7 here to & indeed it works here too
It fails on YAM2.9 and on YAM2.10Dev

Go to top

  Register To Post
(1) 2 »

 




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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project