Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

 
SOLVED
Go to solution
Heinz W Genhart
Honored Contributor

How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

Hi community

does somebody know how to do a

$ SET DISPLAY/CREATE/NODE= /TRANSPORT= /SERVER= /SCREEN=

in a language like C or Pascal ?

Regards

Geni
8 REPLIES
Steve-Thompson
Regular Advisor

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

Hi Heinz
It's Friday and I'm just out the door, but..

sys$examples ... [.decw] has a few C programs in it.

Any good?

Steven
Walter Miller_1
Valued Contributor

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

A simple way is to use the C run-time function "system".

#include

int system (const char *string);

This passes the string to the host environment to be executed by the command processor.
Heinz W Genhart
Honored Contributor

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

Steve: There is no example for this

Walter: There is a possibility to the oposite (SHOW DISPLAY) with a QIO and a undocumented IO$_SENSEMODE | IO$M_WS_DISPLAY.

I Would prefere a solution with a qio or another system_service
Ian Miller.
Honored Contributor

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

have a look at create_decterm.c and .com in
http://h71000.www7.hp.com/freeware/freeware40/srh_examples/
____________________
Purely Personal Opinion
Fekko Stubbe
Valued Contributor

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

I have some code that asks for the values (in fortran)
c
c the below values should be in $iodef
c but in fortran they are not there so
c I define them myself.
c
integer*4 decw$c_ws_dsp_node
parameter (decw$c_ws_dsp_node=1)
integer*4 decw$c_ws_dsp_transport
parameter (decw$c_ws_dsp_transport=2)
integer*4 decw$c_ws_dsp_server
parameter (decw$c_ws_dsp_server=3)
integer*4 decw$c_ws_dsp_screen
parameter (decw$c_ws_dsp_screen=4)
integer*4 io$m_ws_display
parameter (io$m_ws_display=64)
c
c First try the DECW$DISPLAY
c
istat= sys$assign('decw$display',chan,,,)
if(istat) then
c
c decw$display exists, so now get it
c THis code gets the value, but if you
c replace the sensmode with setmode, it
c should set it
c
opcode = io$_sensemode .or. io$m_ws_display
c
c Get transportname
c
istat = sys$qiow(%val(EFN$C_ENF),%val(chan),%val(opcode),iosb,,,
1 %ref(transportname),%val(len(transportname)),
1 %val(decw$c_ws_dsp_transport),,,)
if(istat) istat = iosb.wstatus
c
c I assume you can translate to c
c You need 4 qios to set all elements
c
Hoff
Honored Contributor

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

Allocate and open a channel to WSA0:, and toss an IO$_SETMODE [masked with whatever the WS arguments] at the WSAu: cloned device, and off you go.

If you're creating a process and seeking to have it use DECwindows to display output, you can pass in the WSAu: device into the created process. LOGINOUT looks at the I/O channels to decide what its target is; toss the WSAu: cloned device at all three arguments; input, output and error.

I'll post an article on this topic over at the new HoffmanLabs site later today.

Stephen Hoffman
HoffmanLabs LLC

Hoff
Honored Contributor
Solution

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

Article and C code (SENSEMODE, not SETMODE) posted to http://64.223.189.234/node/375
Heinz W Genhart
Honored Contributor

Re: How to do a SET DISPLAY/CREATE/NODE=/TRANSPORT=/SERVER=/SCREEN= in C or Pascal

Hi Fekko and Hoff

Thanks a lot. I will be able to solve the problem now by using SETMODE instead of sensemode. I wrote a hack to test it and it seems that this is working well.

Thanks

Geni