home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / health / exitsave.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-07-21  |  6.3 KB  |  209 lines

  1. VERSION 2.00
  2. Begin Form exitsave 
  3.    BackColor       =   &H00808000&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   3765
  7.    ClientLeft      =   2715
  8.    ClientTop       =   1500
  9.    ClientWidth     =   4095
  10.    Height          =   4170
  11.    Left            =   2655
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   3765
  15.    ScaleWidth      =   4095
  16.    Top             =   1155
  17.    Width           =   4215
  18.    Begin CommandButton Command1 
  19.       Caption         =   "Cancel"
  20.       Height          =   375
  21.       Index           =   2
  22.       Left            =   2880
  23.       TabIndex        =   3
  24.       Top             =   3240
  25.       Width           =   975
  26.    End
  27.    Begin CommandButton Command1 
  28.       Caption         =   "Exit"
  29.       Height          =   375
  30.       Index           =   1
  31.       Left            =   1560
  32.       TabIndex        =   2
  33.       Top             =   3240
  34.       Width           =   975
  35.    End
  36.    Begin CommandButton Command1 
  37.       Caption         =   "Save"
  38.       Enabled         =   0   'False
  39.       Height          =   375
  40.       Index           =   0
  41.       Left            =   240
  42.       TabIndex        =   1
  43.       Top             =   3240
  44.       Width           =   975
  45.    End
  46.    Begin Timer Timer1 
  47.       Left            =   360
  48.       Top             =   2520
  49.    End
  50.    Begin PictureBox Picture1 
  51.       BackColor       =   &H00808000&
  52.       BorderStyle     =   0  'None
  53.       Height          =   2175
  54.       Index           =   0
  55.       Left            =   1440
  56.       Picture         =   EXITSAVE.FRX:0000
  57.       ScaleHeight     =   2175
  58.       ScaleWidth      =   1215
  59.       TabIndex        =   0
  60.       Top             =   840
  61.       Width           =   1215
  62.    End
  63.    Begin PictureBox Picture1 
  64.       BackColor       =   &H00808000&
  65.       BorderStyle     =   0  'None
  66.       Height          =   2175
  67.       Index           =   2
  68.       Left            =   2880
  69.       Picture         =   EXITSAVE.FRX:12F0
  70.       ScaleHeight     =   2175
  71.       ScaleWidth      =   1215
  72.       TabIndex        =   5
  73.       Top             =   0
  74.       Visible         =   0   'False
  75.       Width           =   1215
  76.    End
  77.    Begin PictureBox Picture1 
  78.       BackColor       =   &H00808000&
  79.       BorderStyle     =   0  'None
  80.       Height          =   2175
  81.       Index           =   1
  82.       Left            =   0
  83.       Picture         =   EXITSAVE.FRX:25E0
  84.       ScaleHeight     =   2175
  85.       ScaleWidth      =   1215
  86.       TabIndex        =   4
  87.       Top             =   0
  88.       Visible         =   0   'False
  89.       Width           =   1215
  90.    End
  91. Sub Command1_Click (Index As Integer)
  92. Select Case Index
  93. Case 0
  94.         If command1(0).caption = "New" Then
  95.                 admit.picture1.tag = "new"
  96.                 command1(0).caption = "Save"
  97.                 command1(2).caption = "Cancel"
  98.                 timer1.interval = 1
  99.                 timer1.enabled = -1
  100.         Else
  101.             picture1(0).picture = picture1(1).picture
  102.             Cls
  103.             msg$ = "Data Saved"
  104.             currenty = 0
  105.             currentx = (exitsave.scalewidth - TextWidth(msg$)) / 2
  106.             Print msg$
  107.             msg$ = "Patient Number " + Str$(curpatID)
  108.             currentx = (exitsave.scalewidth - TextWidth(msg$)) / 2
  109.             Print msg$
  110.             picture1(0).Refresh
  111.             exitsave.Refresh
  112.             screen.mousepointer = 11
  113.             saveproc
  114.             screen.mousepointer = 0
  115.             command1(0).caption = "New"
  116.             command1(1).caption = "Exit"
  117.             admit.picture2.tag = "Exit"
  118.             command1(2).caption = "Continue"
  119.             admit.picture1.tag = ""
  120.         End If
  121. Case 1
  122. If command1(1).caption = "Exit" Then
  123.         'If TYPECHECK Then
  124.             'If FINALCHECK Then
  125.                 msg$ = "Are You Sure You Want to Exit?"
  126.                 x% = MsgBox(msg$, 3, "DISPOSITION DIALOG")
  127.                 If x% = 6 Then
  128.                         timer1.interval = 1
  129.                         timer1.enabled = -1
  130.                         Endroutine
  131.                 End If
  132.                 If x% = 2 Then
  133.                         timer1.interval = 1
  134.                         timer1.enabled = -1
  135.                 End If
  136.             'End If
  137.         'End If
  138. End If
  139. If command1(1).caption = "Clear" Then
  140.         msg$ = "Clear All Patient Data Now?"
  141.         x% = MsgBox(msg$, 4, "DISPOSITION DIALOG")
  142.         If x% = 6 Then
  143.                 clearoutine
  144.                 Cls
  145.                 msg$ = "All Patient Data Cleared"
  146.                 currenty = 0
  147.                 currentx = (exitsave.scalewidth - TextWidth(msg$)) / 2
  148.                 Print msg$
  149.                 msg$ = "Patient Number " + Str$(curpatID)
  150.                 currentx = (exitsave.scalewidth - TextWidth(msg$)) / 2
  151.                 Print msg$
  152.                 picture1(0).picture = picture1(2).picture
  153.                 admit.picture1.tag = "new"
  154.                 timer1.interval = 1600
  155.                 timer1.enabled = -1
  156.         End If
  157.         admit.picture2.tag = "Exit"
  158. End If
  159. Case 2
  160. If command1(2).caption = "Continue" Then
  161.         Cls
  162.         msg$ = "File Reopened"
  163.         currenty = 0
  164.         currentx = (exitsave.scalewidth - TextWidth(msg$)) / 2
  165.         Print msg$
  166.         msg$ = "Patient Number " + Str$(patientID(1))
  167.         currentx = (exitsave.scalewidth - TextWidth(msg$)) / 2
  168.         Print msg$
  169.         picture1(0).picture = picture1(2).picture
  170.         timer1.interval = 1300
  171.         timer1.enabled = -1
  172.         timer1.interval = 1
  173.         timer1.enabled = -1
  174. End If
  175. End Select
  176. End Sub
  177. Sub Form_Load ()
  178. If TYPECHECK Then
  179. command1(0).enabled = -1
  180. command1(0).enabled = 0
  181. End If
  182. autoredraw = -1
  183. forecolor = QBColor(15)
  184. fontname = "ms sans serif"
  185. fontsize = 12
  186. command1(1).caption = admit.picture2.tag
  187.     If command1(1).caption = "Clear" Then
  188.     msg$ = "Wipe The Current Patient Data?"
  189.     Else
  190.     command1(1).caption = "Exit"
  191.     msg$ = "Save The Current Patient Data?"
  192.     End If
  193. currenty = 0
  194. currentx = (exitsave.scalewidth - TextWidth(msg$)) / 2
  195. Print msg$
  196. End Sub
  197. Sub Timer1_Timer ()
  198. Static secondtime As Integer
  199. exitsave.visible = 0
  200.     If secondtime Then
  201.     timer1.enabled = 0
  202.     secondtime = 0
  203.     Unload exitsave
  204.     Exit Sub
  205.     End If
  206. timer1.interval = 357
  207. secondtime = -1
  208. End Sub
  209.