Problem with gethostname.p & OPSYS

rairch

New Member
Hi,

Progress v91D
Linux 2.4.9-e.49

Running a server side program from a WebSpeed form submit which amongst other things sends an email, however I'm having a problem with the OPSYS variable when trying to return hostname within smtpmail.

Codestub below from gethostname.p:

DEFINE OUTPUT PARAMETER p-TcpName AS CHARACTER NO-UNDO.

MESSAGE "OPSYS: " OPSYS. /* THIS RETURNS UNIX */

&IF OPSYS = "UNIX" &THEN /* THIS FAILS */
&SCOPED-DEFINE SC STREAM cmdstream
DEFINE {&SC}.
INPUT {&SC} THROUGH VALUE("hostname -f").
IMPORT {&SC} UNFORMATTED p-TcpName.
INPUT {&SC} CLOSE.
&ELSE
<Do windows stuff which I don't want>
&ENDIF


Despite my message saying the OPSYS is UNIX the &IF statement then fails.

Anyone have any ideas as I'm sure I'm missing something really obvious here.......
 

rairch

New Member
Ok so compiling it against Linux rather than in the AppBuilder may help a little........d'oh!
 

jdgibson

New Member
Hi,

Progress v91D
Linux 2.4.9-e.49

Running a server side program from a WebSpeed form submit which amongst other things sends an email, however I'm having a problem with the OPSYS variable when trying to return hostname within smtpmail.

Codestub below from gethostname.p:

DEFINE OUTPUT PARAMETER p-TcpName AS CHARACTER NO-UNDO.

MESSAGE "OPSYS: " OPSYS. /* THIS RETURNS UNIX */

&IF OPSYS = "UNIX" &THEN /* THIS FAILS */
&SCOPED-DEFINE SC STREAM cmdstream
DEFINE {&SC}.
INPUT {&SC} THROUGH VALUE("hostname -f").
IMPORT {&SC} UNFORMATTED p-TcpName.
INPUT {&SC} CLOSE.
&ELSE
<Do windows stuff which I don't want>
&ENDIF


Despite my message saying the OPSYS is UNIX the &IF statement then fails.

Anyone have any ideas as I'm sure I'm missing something really obvious here.......


You are confusing the OPSYS function with the OPSYS preprocessor name. If you want to use it with &IF it should be {&OPSYS}.

If you want to use OPSYS it should

If OPSYS
 

Afshin

New Member
Re: How can I find gethostname.p

Hi everybody,

I have some problem to find gethostname.p ?

Do someone knows the location to download that. Thanx alot for helping me to find that because I do have found smtpmail.p but not gethostname.p.

Best regards
 
Top