home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / CLIPPER / SCRNUZ / MEM_PROC.PRG < prev    next >
Text File  |  1992-05-08  |  6KB  |  247 lines

  1. *.............................................................................
  2. *
  3. *   Program Name: MEM_PROC.PRG      Copyright: EDON Corporation
  4. *   Date Created: 02/25/91           Language: Clipper S'87
  5. *   Time Created: 13:12:00             Author: Ed Phillips
  6. *           Desc:
  7. *.............................................................................
  8.  
  9. *----------------------------
  10. *         Author: Ed Phillips
  11. *   Date Created: 03/31/91
  12. *   Put cursor at r,c
  13. *----------------------------
  14. FUNCTION Gotoxy
  15.    PARAMETERS r,c
  16.  
  17.    @ r,c SAY ''
  18. RETURN(.T.)
  19.  
  20.  
  21. PROCEDURE DrawScreen
  22.    PARAMETERS attribs
  23.  
  24.    IF ! Empty(fname)
  25.       buffer1 = Memoread(fname)
  26.       fname = Space(20)
  27.    ENDIF
  28.  
  29.    IF attribs
  30.       Restscreen(1,0,24,79,buffer1)
  31.    ELSE
  32.       lines = Mlcount(buffer1,80)
  33.       lc = 1
  34.       @ 1,0 CLEAR 
  35.       FOR i = 1 TO lines
  36.          p_line = Memoline(buffer1,80,i)
  37.          @ lc,0 SAY p_line
  38.          lc = lc + 1
  39.       NEXT
  40.    ENDIF                                         
  41.  
  42. RETURN 
  43.  
  44. *----------------------------
  45. *         Author: Ed Phillips
  46. *   Date Created: 02/22/91
  47. *----------------------------
  48. PROCEDURE MakeScreen
  49.    PRIVATE temp[8]
  50.  
  51.    temp[1] = 'Scrn_name C0010'
  52.    temp[2] = 'Screen    C4000'
  53.    temp[3] = 'St        N0002'
  54.    temp[4] = 'Sl        N0002'
  55.    temp[5] = 'Sb        N0002'
  56.    temp[6] = 'Sr        N0002'
  57.    temp[7] = 'Shadow    L0001'
  58.    temp[8] = 'Explode   N0001'
  59.  
  60.    CreateDBF('Screen',temp)
  61. RETURN
  62.  
  63. *----------------------------
  64. *         Author: Ed Phillips
  65. *   Date Created: 02/25/91
  66. *----------------------------
  67. PROCEDURE MakeGets
  68.    PRIVATE temp[12]
  69.  
  70.    temp[1] = 'Scrn_name C0010'
  71.    temp[2] = 'G_row     N0002'
  72.    temp[3] = 'G_col     N0002'
  73.    temp[4] = 'G_pic     C0030'
  74.    temp[5] = 'G_var     C0013'
  75.    temp[6] = 'G_valid   C0030'
  76.    temp[7] = 'G_color   C0020'
  77.    temp[8] = 'G_when    C0030'
  78.    temp[9] = 'Say_exp   C0040'
  79.    temp[10] = 'Say_pict  C0030'
  80.    temp[11] = 'Say_color C0020'
  81.    temp[12] = 'Gs_flag   C0001'
  82.  
  83.    CreateDBF('ScrnGets',temp)
  84. RETURN
  85.  
  86. *----------------------------
  87. *         Author: Ed Phillips
  88. *   Date Created: 12/10/91
  89. *----------------------------
  90. PROCEDURE MakeMenu
  91.    PRIVATE temp[7]
  92.  
  93.    temp[1] = 'Scrn_name C0010'
  94.    temp[2] = 'M_row     N0002'
  95.    temp[3] = 'M_col     N0002'
  96.    temp[4] = 'M_func    C0040'
  97.    temp[5] = 'M_prompt  C0070'
  98.    temp[6] = 'M_msg     C0070'
  99.    temp[7] = 'M_cargo   C0070'
  100.  
  101.    CreateDBF('ScrnMenu',temp)
  102. RETURN
  103.  
  104. *----------------------------
  105. *         Author: Ed Phillips
  106. *   Date Created: 12/12/91
  107. *----------------------------
  108. PROCEDURE MakeRpts
  109.    PRIVATE temp[9]
  110.  
  111.    temp[1] = 'Scrn_name C0010'
  112.    temp[2] = 'Rptname   C0008'
  113.    temp[3] = 'Phdr      C0010'
  114.    temp[4] = 'Detproc   C0010'
  115.    temp[5] = 'Maincond  C0070'
  116.    temp[6] = 'Detcond   C0070'
  117.    temp[7] = 'Ftrproc   C0010'
  118.    temp[8] = 'Rpt_wid   N0003'
  119.    temp[9] = 'Lm        N0002'
  120.  
  121.    CreateDBF('ScrnRpts',temp)
  122. RETURN
  123.  
  124. *----------------------------
  125. *         Author: Ed Phillips
  126. *   Date Created: 02/22/91
  127. *   Strip attribute bytes from a Screen Memvar
  128. *----------------------------
  129. FUNCTION SaveWinTxt
  130.    PARAMETERS t,l,b,r
  131.    PRIVATE temp, ret_val, charcnt, i, j
  132.  
  133.    temp = Savescreen(t,l,b,r)
  134.    charcnt = (r - l + 1) * (b - t + 1)
  135.    ret_val = ' '
  136.    j = 1
  137.    FOR i = 1 TO charcnt
  138.       ret_val = ret_val + Subs(temp,j,1)
  139.       j = j + 2
  140.    NEXT                                          
  141.  
  142. RETURN( Subs(ret_val,2) )
  143.  
  144. *----------------------------
  145. *         Author: Ed Phillips
  146. *   Date Created: 02/22/91
  147. *   Display a Screen Memvar
  148. *----------------------------
  149. FUNCTION SayWinTxt
  150.    PARAMETERS t,l,b,r,string
  151.    PRIVATE width,num_ln, i, j
  152.  
  153.    width = r - l + 1
  154.    num_ln = Len(string)/width
  155.    t = t - 1
  156.    j = 1
  157.    FOR i = 1 TO num_ln
  158.        @ t+i,l SAY Subs(string,j,width)
  159.        j = j + width
  160.    NEXT                                          
  161.  
  162. RETURN(.T.)
  163.  
  164. *----------------------------
  165. *         Author: Ed Phillips
  166. *   Date Created: 02/22/91
  167. *----------------------------
  168. PROCEDURE SwapChk
  169.    PRIVATE temp
  170.  
  171.    IF left > right
  172.       temp = right
  173.       right = left
  174.       left = temp
  175.    ENDIF                                         
  176.    IF top > bottom
  177.       temp = bottom
  178.       bottom = top
  179.       top = temp
  180.    ENDIF                                         
  181. RETURN
  182.  
  183. *----------------------------
  184. *         Author: Ed Phillips
  185. *   Date Created: 02/25/91
  186. *----------------------------
  187. FUNCTION RestGets
  188.    PRIVATE oldcolor, r, c
  189.  
  190.    IF showgm
  191.       oldcolor = Setcolor()
  192.       SELECT ScrnGets
  193.       SEEK Scr_file->Scrn_name
  194.    
  195.       DO WHILE Scrn_name = Scr_file->Scrn_name .AND. ! Eof()
  196.          @ G_row, G_col SAY ''
  197.          r = G_row
  198.          c = G_col
  199.          DO ScrnAttrib
  200.          @ G_row, G_col SAY gchar
  201.          SKIP
  202.       ENDDO                                         
  203.       SELECT Scr_file
  204.       Setcolor(oldcolor)
  205.    ENDIF
  206.  
  207. RETURN(.T.)
  208.  
  209. *----------------------------
  210. *         Author: Ed Phillips
  211. *   Date Created: 12/10/91
  212. *----------------------------
  213. FUNCTION RestMenu
  214.    PRIVATE oldcolor, r, c
  215.  
  216.    IF showgm
  217.       oldcolor = Setcolor()
  218.       SELECT ScrnMenu
  219.       SEEK Scr_file->Scrn_name
  220.    
  221.       DO WHILE Scrn_name = Scr_file->Scrn_name .AND. ! Eof()
  222.          @ M_row, M_col SAY ''
  223.          r = M_row
  224.          c = M_col
  225.          DO ScrnAttrib
  226.          @ M_row, M_col SAY mchar
  227.          SKIP
  228.       ENDDO                                         
  229.       SELECT Scr_file
  230.       Setcolor(oldcolor)
  231.    ENDIF
  232. RETURN(.T.)
  233.  
  234. *----------------------------
  235. *         Author: Ed Phillips
  236. *   Date Created: 02/28/91
  237. *   Is the current screen a sub-screen?
  238. *----------------------------
  239. FUNCTION IsSub
  240.    IF (Sb - St = 23) .AND. (Sr - Sl = 79)
  241.       RETURN .f.
  242.    ELSE
  243.       RETURN .t.
  244.    ENDIF
  245. *----------------------------
  246. * EOF: MEM_PROC.PRG
  247.