~ubuntu-branches/debian/jessie/eso-midas/jessie

« back to all changes in this revision

Viewing changes to prim/proc/assign.prg

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-okiwi1assxkkiz39
Tags: upstream-13.09pl1.2+dfsg
ImportĀ upstreamĀ versionĀ 13.09pl1.2+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
! @(#)assign.prg        19.1 (ES0-DMD) 02/25/03 14:08:44
 
2
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
3
!
 
4
! MIDAS procedure assign.prg for ASSIGN/PRINT, /INPUT, /DISPLAY, /DEFAULTS
 
5
! K. Banse      910404, 920423, 930714, 940511, 021213
 
6
!
 
7
! execute via ASSIGN/qualif device
 
8
! qualif = PRINT, INPUT, DISPLAY, DEFAULTS
 
9
! device = TERMINAL, LPRINT, LASER, COLOUR, SLIDE, VERSA, DISPLAY
 
10
!     or = FILE file_name
 
11
!
 
12
! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
13
 
14
! branch according to qualifier...
 
15
branch mid$cmnd(11:12) PR,IN,DI,DE PRINT,INPUT,DISPLAY,DEFAULTS
 
16
!
 
17
! invalid qualifier - display relevant message
 
18
write/error 3
 
19
return
 
20
!
 
21
! handle ASSIGN/PRINT
 
22
!
 
23
PRINT:
 
24
define/param p1 LPRINT ? "Enter print device: "
 
25
!
 
26
define/local symbol/c/1/60 " " all
 
27
write/keyw mid$prnt/c/1/60 " " all              !clear keyword first
 
28
!
 
29
if p1(1:3) .eq. "TER" then
 
30
   write/keyw mid$prnt T:User_Terminal          !User terminal
 
31
!
 
32
elseif p1(1:3) .eq. "LAS" then
 
33
   symbol = m$symbol("PLASER")                  !use procedure for
 
34
   write/keyw mid$prnt "L:{SYMBOL(1:58)}"       !Laser printers
 
35
!
 
36
elseif p1(1:3) .eq. "FIL" then
 
37
   define/param p2 ? ? "Enter filename: "
 
38
   write/keyw mid$prnT F:{p2}                   !user defined file
 
39
!
 
40
elseif p1(1:3) .eq. "PRI" then
 
41
   symbol = m$symbol("LPRINT")                  !use procedure for
 
42
   write/keyw mid$prnt "P:{symbol(1:58)}"       !Line printers
 
43
!
 
44
else                                            !the default
 
45
   symbol = m$symbol(p1)
 
46
   if symbol(1:1) .eq. " " then                
 
47
      if aux_mode(1) .lt. 2 then
 
48
         write/keyw mid$prnt "P:PRINT/QUEUE={p1}"
 
49
      else
 
50
         write/keyw mid$prnt "P:{p1(1:58)}"
 
51
      endif
 
52
   else
 
53
      write/keyw mid$prnt "P:{symbol(1:58)}"
 
54
   endif
 
55
endif
 
56
return
 
57
!
 
58
! handle ASSIGN/INPUT
 
59
!
 
60
INPUT:
 
61
write/keyw mid$in/c/1/20 " " all                        !clear keyword first
 
62
if p1(1:1) .eq. "F" then
 
63
   define/param p2 ? ? "Enter filename: "
 
64
   write/keyw mid$in F:{p2}
 
65
else
 
66
   if p1(1:1) .ne. "T" -
 
67
      write/out "Unsupported device - defaulted to TERMINAL"
 
68
   write/keyw mid$in T:USER_TERM                !User terminal
 
69
endif
 
70
return
 
71
!
 
72
! handle ASSIGN/DISPLAY
 
73
!
 
74
DISPLAY:
 
75
define/param p1 DISPLAY ? "Enter display device: "
 
76
!
 
77
define/local symbol/c/1/20 " " all
 
78
write/keyw mid$disp/c/1/20 " " all              !clear keyword first
 
79
define/local ll/i/1/2 0,0 
 
80
!
 
81
if p1(1:3) .eq. "LAS" then
 
82
   symbol = m$symbol("LASER")                   !use full name of laser device
 
83
   write/keyw mid$disp L_{symbol}               !PostScript laser printer
 
84
!
 
85
elseif p1(1:3) .eq. "FIL" then
 
86
   define/param p2 ? ? "Enter filename: "
 
87
   write/keyw mid$disp F_{p2}
 
88
!
 
89
elseif p1(1:1) .eq. "D" then
 
90
   ll = m$index(p1,",")+1
 
91
   if ll .le. 1 then
 
92
      write/keyw ll/i/1/2 1,{dazdevr(10)}
 
93
   else
 
94
      write/keyw ll/i/2/1 {p1({ll}:)} 
 
95
   endif
 
96
   goto disp_check
 
97
 
98
elseif m$tstno(p1) .eq. 1 then          !handle simple number as if d,no.
 
99
   write/keyw ll/i/1/2 1,{p1} 
 
100
   goto disp_check
 
101
 
102
elseif p1(1:3) .eq. "COL" then
 
103
   symbol = m$symbol("COLOUR")                  !use full name
 
104
   write/keyw mid$disp C_{symboL}               !colour Postscript laser printer
 
105
 
106
elseif p1(1:3) .eq. "SLI" then
 
107
   symbol = m$symbol("SLIDE")                   !use full name
 
108
   write/keyw mid$disp C_{symbol}               !colour filme recorder
 
109
 
110
else
 
111
   write/keyw mid$disp L_{p1}                   !the default
 
112
endif
 
113
return
 
114
 
115
disp_check:
 
116
write/keyw mid$disp I_ImageDisplay
 
117
 
118
if ll(2) .lt. 0 .or. ll(2) .gt. 9 goto error_back
 
119
set/forma i1
 
120
!
 
121
!  check, if we have a display...
 
122
if mid$sess(6:6) .eq. " " .or. mid$sess(6:6) .eq. "-" then
 
123
   write/out "display window {ll(2)} created by MIDAS ..."
 
124
   create/display {ll(2)}
 
125
else
 
126
   @ creadisp.prg_o {ll(2)} -999        !execute the former switch/display
 
127
endif
 
128
return
 
129
!
 
130
!
 
131
! handle ASSIGN/DEFAULTS - set default devices
 
132
!
 
133
DEFAULTS:
 
134
define/local symbol/c/1/60 " " all
 
135
symbol = m$symbol("LPRINT")                     !default is line printer
 
136
write/keyw mid$prnt "P:{symbol(1:58)}"
 
137
write/keyw mid$in T:User_Terminal               !User terminal
 
138
write/keyw mid$disp I_ImageDisplay              !image display is default
 
139
write/keyw mid$plot/c/1/20 GRAPH_WND{mid$sess(7:7)}
 
140
write/keyw mid$plot/c/21/10 "NOSPOOL"           !default to spool
 
141
return
 
142
 
143
ERROR_BACK:
 
144
write/out "Invalid input..."