home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 November / Pcwk1197.iso / LOTUS / Eng-ins / SMASTERS / APPROACH / DB2WWW.MPR / SCRIPT / A007AppAppObj888.s (.txt) < prev    next >
Null Bytes Alternating  |  1997-01-09  |  6KB  |  91 lines

  1. '++LotusScript Development Environment:2:5:(Options):0:66
  2.  
  3. '++LotusScript Development Environment:2:5:(Forward):0:1
  4. Declare Sub Documentopened(Source As Application, Document As DOCUMENT)
  5. Declare Sub ClearVals
  6. Declare Sub Documentclose(Source As Application)
  7.  
  8. '++LotusScript Development Environment:2:5:(Declarations):0:2
  9.  
  10. '++LotusScript Development Environment:2:2:BindEvents:1:129
  11. Private Sub BindEvents(Byval Objectname_ As String)
  12.     Static Source As APPLICATION
  13.     Set Source = Bind(Objectname_)
  14.     On Event Documentopened From Source Call Documentopened
  15.     On Event Documentclose From Source Call Documentclose
  16. End Sub
  17.  
  18. '++LotusScript Development Environment:2:2:Documentopened:1:12
  19. Sub Documentopened(Source As Application, Document As DOCUMENT)
  20.     On Error Resume Next    
  21.     If gInit = 1 Then
  22.         End
  23.     End If
  24.     'Make sure the collections are updated first
  25.     Doevents
  26.     If Lcase$(Left(Document.name ,6)) = "db2www" Then
  27.         i = 0
  28.         'CurrentApplication.visible = False
  29.         CurrentDocument.window.visible = False
  30.         gFlagLoaded = 0 'Flag used to determine if values in assistant need to be reset
  31.         gPageLoaded = 0
  32.         gCurPage = 1
  33.         WebTemplate = ""
  34.         Set CurrentWindow.Activeview =CurrentDocument.WWW~ Assistant
  35.         Call Clearvals
  36.         gInit = 1
  37.     End If
  38.     Err = 0
  39. End Sub
  40. '++LotusScript Development Environment:2:2:ClearVals:1:8
  41. Sub ClearVals
  42.     On Error Resume Next
  43.     'Dim obtype As Long
  44.     
  45.     'blank out some values and set some default values
  46.     numrows = 0
  47.     c = 0
  48.     '**************There's currently a problem with accesssing all the objects on a multipage form, so we'll specify
  49.     'what we want cleared:
  50.     With CurrentDocument.WWW~ Assistant.body
  51.         .txtimagepath.text = "\images"
  52.         .txtmacropath.text = ""
  53.         .txtExeName.text = ""
  54.         .txtnumrows.text=""
  55.         .cbxPromptUserid.setstate(True)
  56.         .cbxUseUserid.setstate(True)
  57.         .cbxUsePswd.setstate(True)
  58.         .rdoSqlOff.setstate(True)
  59.         .rdoSearchAnd.setstate(True)
  60.         .rdoNoConvert.setstate(True)
  61.         .rdoFormPost.setstate(True)
  62.         
  63.         'one panel2
  64.         source.lbformsP2.background.color.setrgb color_white
  65.         source.lbformsP2.font.color.setrgb color_black
  66.         source.lbformsP2.readonly = False
  67.         
  68.         'Let's set default values into the Step 3 screen:
  69.         .txtUserid.readonly = 0
  70.         .txtPswd.readonly = 0
  71.         .txtUserid.background.color.setrgb color_white
  72.         .txtPswd.background.color.setrgb color_white
  73.         .txtUserid.text = "userid"
  74.         .txtPswd.text = "password"    
  75.         
  76.         'Default values in panel 4:
  77.         .txtNumRows.text = "0"  'The number of rows to return in the report
  78.         .txtNumRows.background.color.setrgb color_30_gray
  79.         .txtNumRows.font.color.setrgb color_12_gray
  80.         
  81.         'default values in panel 5:
  82.         .txtImagePath.text = "/images"
  83.         .txtExeName.text = "/cgi-bin/db2www.exe"
  84.     End With
  85.     'Clear any errors 
  86.     Err = 0
  87. End Sub
  88. '++LotusScript Development Environment:2:2:Documentclose:1:12
  89. Sub Documentclose(Source As Application)
  90.     ReturnWinTitle
  91. End Sub