home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / vbasic / webx_setup.exe / %MAINDIR% / Samples / WebServer / WebXSampleApp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-06-18  |  23.0 KB  |  641 lines

  1. VERSION 5.00
  2. Object = "{60F3DD10-54A1-416D-835C-B8371C544B98}#4.0#0"; "WebX.ocx"
  3. Begin VB.Form frmWebXSampleApp 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "WebX Sample Application"
  6.    ClientHeight    =   6630
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   7215
  10.    Icon            =   "WebXSampleApp.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   6630
  15.    ScaleWidth      =   7215
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin WebXServer.WebX WebX1 
  18.       Height          =   1080
  19.       Left            =   6000
  20.       Top             =   4500
  21.       Width           =   1080
  22.       _ExtentX        =   1905
  23.       _ExtentY        =   1905
  24.       ServerName      =   "kcsnt02"
  25.    End
  26.    Begin VB.Frame Frame1 
  27.       Caption         =   "Options"
  28.       BeginProperty Font 
  29.          Name            =   "MS Sans Serif"
  30.          Size            =   8.25
  31.          Charset         =   0
  32.          Weight          =   700
  33.          Underline       =   0   'False
  34.          Italic          =   0   'False
  35.          Strikethrough   =   0   'False
  36.       EndProperty
  37.       Height          =   1215
  38.       Left            =   60
  39.       TabIndex        =   27
  40.       Top             =   4380
  41.       Width           =   5835
  42.       Begin VB.CheckBox chkTrap 
  43.          Caption         =   "Trap Requests"
  44.          Height          =   255
  45.          Left            =   4020
  46.          TabIndex        =   8
  47.          Top             =   240
  48.          Value           =   1  'Checked
  49.          Width           =   1755
  50.       End
  51.       Begin VB.TextBox txtServerPort 
  52.          Height          =   285
  53.          Left            =   1020
  54.          TabIndex        =   3
  55.          Text            =   "80"
  56.          Top             =   540
  57.          Width           =   675
  58.       End
  59.       Begin VB.CheckBox chkHTMLFunc 
  60.          Caption         =   "HTML Functions"
  61.          Height          =   255
  62.          Left            =   4020
  63.          TabIndex        =   9
  64.          Top             =   480
  65.          Value           =   1  'Checked
  66.          Width           =   1755
  67.       End
  68.       Begin VB.CheckBox chkISAPI 
  69.          Caption         =   "ISAPI Scripts"
  70.          Height          =   255
  71.          Left            =   2160
  72.          TabIndex        =   7
  73.          Top             =   720
  74.          Value           =   1  'Checked
  75.          Visible         =   0   'False
  76.          Width           =   1755
  77.       End
  78.       Begin VB.CheckBox chkSSI 
  79.          Caption         =   "SSI Variables"
  80.          Height          =   255
  81.          Left            =   2160
  82.          TabIndex        =   6
  83.          Top             =   480
  84.          Value           =   1  'Checked
  85.          Width           =   1755
  86.       End
  87.       Begin VB.CheckBox chkCGI 
  88.          Caption         =   "CGI Scripts"
  89.          Height          =   255
  90.          Left            =   2160
  91.          TabIndex        =   5
  92.          Top             =   240
  93.          Value           =   1  'Checked
  94.          Width           =   1755
  95.       End
  96.       Begin VB.CheckBox chkEnableLB 
  97.          Caption         =   "Enable List Box"
  98.          Height          =   255
  99.          Left            =   120
  100.          TabIndex        =   4
  101.          ToolTipText     =   "Enable list box above. If enabled, test app will run slower."
  102.          Top             =   900
  103.          Value           =   1  'Checked
  104.          Width           =   1755
  105.       End
  106.       Begin VB.CheckBox chkVerboseErrors 
  107.          Caption         =   "Verbose Errors"
  108.          Height          =   255
  109.          Left            =   4020
  110.          TabIndex        =   10
  111.          Top             =   720
  112.          Value           =   1  'Checked
  113.          Width           =   1755
  114.       End
  115.       Begin VB.TextBox txtMaxConn 
  116.          Height          =   285
  117.          Left            =   1020
  118.          TabIndex        =   2
  119.          Text            =   "1"
  120.          Top             =   240
  121.          Width           =   675
  122.       End
  123.       Begin VB.Label Label9 
  124.          Caption         =   "HTTP Port"
  125.          Height          =   195
  126.          Left            =   120
  127.          TabIndex        =   31
  128.          Top             =   600
  129.          Width           =   855
  130.       End
  131.       Begin VB.Label Label6 
  132.          Caption         =   "Max Conn"
  133.          Height          =   195
  134.          Left            =   120
  135.          TabIndex        =   28
  136.          Top             =   300
  137.          Width           =   855
  138.       End
  139.    End
  140.    Begin VB.Frame frmSepBottom 
  141.       Height          =   70
  142.       Left            =   60
  143.       TabIndex        =   26
  144.       Top             =   5640
  145.       Width           =   7095
  146.    End
  147.    Begin VB.OptionButton Option1 
  148.       Caption         =   "&Start Server"
  149.       BeginProperty Font 
  150.          Name            =   "MS Sans Serif"
  151.          Size            =   8.25
  152.          Charset         =   0
  153.          Weight          =   700
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       ForeColor       =   &H00008000&
  159.       Height          =   375
  160.       Left            =   4440
  161.       Style           =   1  'Graphical
  162.       TabIndex        =   0
  163.       Top             =   5820
  164.       Width           =   1335
  165.    End
  166.    Begin VB.Timer tmrStats 
  167.       Enabled         =   0   'False
  168.       Interval        =   1000
  169.       Left            =   3960
  170.       Top             =   5820
  171.    End
  172.    Begin VB.Frame frmStats 
  173.       Caption         =   "Stats"
  174.       BeginProperty Font 
  175.          Name            =   "MS Sans Serif"
  176.          Size            =   8.25
  177.          Charset         =   0
  178.          Weight          =   700
  179.          Underline       =   0   'False
  180.          Italic          =   0   'False
  181.          Strikethrough   =   0   'False
  182.       EndProperty
  183.       Height          =   795
  184.       Left            =   60
  185.       TabIndex        =   13
  186.       Top             =   3480
  187.       Width           =   7095
  188.       Begin VB.Label Label7 
  189.          BackStyle       =   0  'Transparent
  190.          Caption         =   "Requests:"
  191.          Height          =   255
  192.          Left            =   4800
  193.          TabIndex        =   25
  194.          Top             =   480
  195.          Width           =   1035
  196.       End
  197.       Begin VB.Label lblReqs 
  198.          Height          =   255
  199.          Left            =   5580
  200.          TabIndex        =   24
  201.          Top             =   480
  202.          Width           =   1335
  203.       End
  204.       Begin VB.Label lblSocketFree 
  205.          Height          =   255
  206.          Left            =   1080
  207.          TabIndex        =   23
  208.          Top             =   480
  209.          Width           =   1335
  210.       End
  211.       Begin VB.Label lblUpTime 
  212.          Height          =   255
  213.          Left            =   1080
  214.          TabIndex        =   22
  215.          Top             =   240
  216.          Width           =   1335
  217.       End
  218.       Begin VB.Label lblReceived 
  219.          Height          =   255
  220.          Left            =   3180
  221.          TabIndex        =   21
  222.          Top             =   240
  223.          Width           =   1335
  224.       End
  225.       Begin VB.Label lblSent 
  226.          Height          =   255
  227.          Left            =   3180
  228.          TabIndex        =   20
  229.          Top             =   480
  230.          Width           =   1335
  231.       End
  232.       Begin VB.Label lblErrors 
  233.          Height          =   255
  234.          Left            =   5580
  235.          TabIndex        =   19
  236.          Top             =   240
  237.          Width           =   1335
  238.       End
  239.       Begin VB.Label Label5 
  240.          BackStyle       =   0  'Transparent
  241.          Caption         =   "Free Conns:"
  242.          Height          =   255
  243.          Left            =   120
  244.          TabIndex        =   18
  245.          Top             =   480
  246.          Width           =   1035
  247.       End
  248.       Begin VB.Label Label1 
  249.          BackStyle       =   0  'Transparent
  250.          Caption         =   "Errors:"
  251.          Height          =   255
  252.          Left            =   4800
  253.          TabIndex        =   17
  254.          Top             =   240
  255.          Width           =   1035
  256.       End
  257.       Begin VB.Label Label2 
  258.          BackStyle       =   0  'Transparent
  259.          Caption         =   "Sent:"
  260.          Height          =   255
  261.          Left            =   2640
  262.          TabIndex        =   16
  263.          Top             =   480
  264.          Width           =   1035
  265.       End
  266.       Begin VB.Label Label3 
  267.          BackStyle       =   0  'Transparent
  268.          Caption         =   "Rcvd:"
  269.          Height          =   255
  270.          Left            =   2640
  271.          TabIndex        =   15
  272.          Top             =   240
  273.          Width           =   1035
  274.       End
  275.       Begin VB.Label Label4 
  276.          BackStyle       =   0  'Transparent
  277.          Caption         =   "Up Time:"
  278.          Height          =   255
  279.          Left            =   120
  280.          TabIndex        =   14
  281.          Top             =   240
  282.          Width           =   1035
  283.       End
  284.    End
  285.    Begin VB.CommandButton cmdExit 
  286.       Caption         =   "E&xit"
  287.       BeginProperty Font 
  288.          Name            =   "MS Sans Serif"
  289.          Size            =   8.25
  290.          Charset         =   0
  291.          Weight          =   700
  292.          Underline       =   0   'False
  293.          Italic          =   0   'False
  294.          Strikethrough   =   0   'False
  295.       EndProperty
  296.       Height          =   375
  297.       Left            =   5820
  298.       Style           =   1  'Graphical
  299.       TabIndex        =   1
  300.       Top             =   5820
  301.       Width           =   1335
  302.    End
  303.    Begin VB.ListBox List1 
  304.       Height          =   3375
  305.       Left            =   0
  306.       TabIndex        =   11
  307.       Top             =   0
  308.       Width           =   7215
  309.    End
  310.    Begin VB.Label Label8 
  311.       Caption         =   "For information about the WebX go to:"
  312.       Height          =   255
  313.       Left            =   60
  314.       TabIndex        =   30
  315.       Top             =   5760
  316.       Width           =   3435
  317.    End
  318.    Begin VB.Label lblWebSite 
  319.       Caption         =   "http://www.futurewavetech.com"
  320.       BeginProperty Font 
  321.          Name            =   "MS Sans Serif"
  322.          Size            =   8.25
  323.          Charset         =   0
  324.          Weight          =   400
  325.          Underline       =   -1  'True
  326.          Italic          =   0   'False
  327.          Strikethrough   =   0   'False
  328.       EndProperty
  329.       ForeColor       =   &H00FF0000&
  330.       Height          =   255
  331.       Left            =   60
  332.       TabIndex        =   29
  333.       ToolTipText     =   "Click here to go to http://www.futurewavetech.com"
  334.       Top             =   6000
  335.       Width           =   3435
  336.    End
  337.    Begin VB.Label lblStatus 
  338.       BorderStyle     =   1  'Fixed Single
  339.       Height          =   255
  340.       Left            =   0
  341.       TabIndex        =   12
  342.       Top             =   6360
  343.       Width           =   7215
  344.    End
  345. Attribute VB_Name = "frmWebXSampleApp"
  346. Attribute VB_GlobalNameSpace = False
  347. Attribute VB_Creatable = False
  348. Attribute VB_PredeclaredId = True
  349. Attribute VB_Exposed = False
  350. Option Explicit
  351. '**************************************************
  352. ' API Declares
  353. '**************************************************
  354. ' ShellExecute - used to launch browser when user
  355. ' clicks on web link label
  356. Private Declare Function ShellExecute Lib "shell32.dll" _
  357.                 Alias "ShellExecuteA" (ByVal hWnd As Long, _
  358.                                        ByVal lpOperation As String, _
  359.                                        ByVal lpFile As String, _
  360.                                        ByVal lpParameters As String, _
  361.                                        ByVal lpDirectory As String, _
  362.                                        ByVal nShowCmd As Long _
  363.                                        ) As Long
  364. '**************************************************
  365. ' Form Events
  366. '**************************************************
  367. Private Sub Form_Initialize()
  368.   With WebX1
  369.       ' Server Params *******************************
  370.       
  371.       ' in minutes, zero = infinite
  372.       .ConnectionTimeout = 10
  373.       
  374.       ' HTML Setup Parameters
  375.       .VirtualPath = App.Path & "\html"
  376.       .CGIDirectory = App.Path & "\scripts"
  377.       .IndexPageNames = "index.html, default.htm"
  378.       .DirectoryBrowseEnable = True
  379.       
  380.       ' Uncomment next two lines to use a text file as the
  381.       ' source of the mime types supported
  382.       '.ContentTypeSourceFile = App.Path & "\mime_lst.txt"
  383.       '.ContentTypeSource = File
  384.       ' Uncomment next line to use the internal table as the
  385.       ' source of the mime types supported
  386.       '.ContentTypeSource = Internal
  387.       
  388.       ' The default ContentTypeSource is the registry
  389.       '.ContentTypeSource = Registry
  390.       
  391.       ' Uncomment next two lines to use a global text file as the
  392.       ' source of the authentication (i.e username and password) file
  393.       ' If a directory has a htaccess.txt file, this global text file
  394.       ' will be used for authentication, and the contents of the
  395.       ' directories htaccess.txt file will be ignored
  396.       '.AuthenticationSourceFile = App.Path & "\pswd_lst.txt"
  397.       '.AuthenticationSource = GolbalFile
  398.       
  399.       ' Uncomment next line to use the the htaccess.txt file that
  400.       ' exists within the target directory
  401.       .AuthenticationSource = DirectoryFile
  402.       
  403.       ' The default AuthenticationSource is the registry (i.e. NT User List)
  404.       '.AuthenticationSource = Registry
  405.   End With
  406. End Sub
  407. Private Sub Form_Load()
  408.     ' In the Demo App the timer interval is set to a small value
  409.     ' for the purpose of iilusation. Normally, the value would be higher
  410.     ' (e.g. 5000 or greater) in a production app.
  411.     tmrStats.Interval = 1000
  412.     tmrStats.Enabled = False
  413. End Sub
  414. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  415. '    Dim sResponse As String
  416. '    sResponse = MsgBox("Are you sure you want to exit?", vbYesNo, "Exit?")
  417. '    If sResponse = vbNo Then Cancel = 1
  418. End Sub
  419. Private Sub Form_Unload(Cancel As Integer)
  420. ' Do NOT use END. It will not clean up properly.
  421. ' After setting classes, recordsets, etc. = nothing
  422. ' unload all the forms you have in the app.
  423.     ' If the server is running, stop it
  424.     If WebX1.ServerRunning = True Then
  425.         tmrStats.Enabled = False
  426.         WebX1.StopServer
  427.     End If
  428.     Unload Me
  429. End Sub
  430. '**************************************************
  431. ' Control Events
  432. '**************************************************
  433. Private Sub cmdExit_click()
  434.     Unload Me
  435. End Sub
  436. Private Sub lblWebSite_Click()
  437. ' Click on web link label will execute shell command that
  438. ' will launch default browser
  439.     Call ShellExecute(0&, vbNullString, lblWebSite.Caption, vbNullString, vbNullString, vbNormalFocus)
  440. End Sub
  441. Private Sub Option1_Click()
  442. ' Option1 has its TabIndex property = 0. This causes it to fire on
  443. ' Form_Load. Set it to another value to make startup of the web
  444. ' server engine a manual operation.
  445.     'On Error GoTo ERROR_W3
  446.     Option1.Enabled = False
  447.     With WebX1
  448.         If .ServerRunning = False Then
  449.             Option1.Caption = "Starting Server..."
  450.             List1.Clear
  451.           
  452.             ' Some Server Setup
  453.             .TrapFileTypes = "html"
  454.             .VerboseErrorsEnable = False
  455.             .CGIEnable = False
  456.             .SSIEnable = False
  457.             .HTMLFunctionsEnable = False
  458.             .TrapFileEnable = False
  459.             
  460.             If chkVerboseErrors = vbChecked Then .VerboseErrorsEnable = True
  461.             If chkCGI.Value = vbChecked Then .CGIEnable = True
  462.             If chkSSI.Value = vbChecked Then .SSIEnable = True
  463.             If chkHTMLFunc.Value = vbChecked Then .HTMLFunctionsEnable = True
  464.             If chkTrap.Value = vbChecked Then .TrapFileEnable = True
  465.             
  466.             .MaxConnections = Val(txtMaxConn.Text)
  467.             .ServerPort = Val(txtServerPort.Text)
  468.             
  469.             .StartServer
  470.             
  471.             tmrStats.Enabled = True
  472.             Option1.Caption = "&Stop Server"
  473.             Option1.ForeColor = vbRed
  474.           
  475.         ElseIf .ServerRunning = True Then
  476.             Option1.Caption = "Stopping Server..."
  477.             tmrStats.Enabled = False
  478.             .StopServer
  479.             Option1.Caption = "&Start Server"
  480.             Option1.ForeColor = &H8000&
  481.         
  482.         Else
  483.             '
  484.           
  485.         End If
  486.     End With
  487.     Option1.Value = False
  488.     Option1.Enabled = True
  489. Exit Sub
  490. ERROR_W3:
  491.   If Err.Number = 10048 Then
  492.       ' Address and port number are already used by another web sever
  493.       MsgBox "There is another Web Server Port number you have " & vbCrLf & _
  494.               "specified. Please choose another HTTP Port." _
  495.               , vbOKOnly, "Error Starting Web Server"
  496.       WebX1.StopServer
  497.       With Option1
  498.           .Value = False
  499.           .Caption = "&Start Server"
  500.           .ForeColor = &H8000&
  501.           .Enabled = True
  502.       End With
  503.       With txtServerPort
  504.         .SetFocus
  505.         .SelLength = Len(.Text)
  506.       End With
  507.       
  508.   Else
  509.       ' All other errors
  510.       MsgBox "There has been an error. " & vbCrLf & vbCrLf & _
  511.               "Error Number = " & Err.Number & vbCrLf & _
  512.               "Error Description = " & Err.Description, vbCritical
  513.   End If
  514. End Sub
  515. Private Sub tmrStats_Timer()
  516. ' Use with caution. On a busy system you do not want to poll the server
  517. ' more than really necessary.
  518.     ' You probably do not want stats reporting to down the App
  519.     On Error Resume Next
  520.     With WebX1
  521.       If .ServerRunning = False Then
  522.           tmrStats.Enabled = False
  523.       Else
  524.           lblUpTime = .Stats_UpTime
  525.           lblReceived = .Stats_BytesReceived
  526.           lblSent = .Stats_BytesSent
  527.           lblSocketFree = .Stats_FreeConnections
  528.           lblErrors = .Stats_Errors
  529.           lblReqs = .Stats_Requests
  530.       End If
  531.     End With
  532.     DoEvents
  533. End Sub
  534. '**************************************************
  535. ' WebX Events
  536. '**************************************************
  537. Private Sub WebX1_FileRequest(Index As Integer, FileName As String, UserAuthentication As String)
  538.     'Debug.Print WebX1.CGIValue(Index, "", vbCrLf)
  539.     Debug.Print FileName
  540.     'Debug.Print UserAuthentication
  541.         
  542.     If UCase(FileName) = UCase("/trap.html") Then
  543.         ' Send data back to Server Engine
  544.         WebX1.TrapFileData Index, "A Trapped Page.", False
  545.         
  546.     Else
  547.         WebX1.TrapFileData Index, "", True
  548.         
  549.     End If
  550. End Sub
  551. Private Sub WebX1_LogEvent(LogEvent As String)
  552.     ' Log to a file or event log
  553.     If chkEnableLB.Value = vbUnchecked Then Exit Sub
  554.     If List1.ListCount > 1000 Then List1.Clear
  555.     List1.AddItem Now & ": " & LogEvent
  556.     List1.ListIndex = List1.ListCount - 1
  557. End Sub
  558. Private Sub WebX1_StatusLine(Data As String)
  559.     lblStatus = " " & Data
  560. End Sub
  561. Private Sub WebX1_HTTPLog(Data As String)
  562. ' The ListBox is used in this Demo App, but should not be used
  563. ' in production applications due to it relativly high CPU usage.
  564. ' Also, do not let the list get too big becuase things really
  565. ' slow down then.
  566.   If chkEnableLB.Value = vbUnchecked Then Exit Sub
  567.   If List1.ListCount > 1000 Then List1.Clear
  568.   List1.AddItem Now & ": " & Data
  569.   List1.ListIndex = List1.ListCount - 1
  570. End Sub
  571. Private Sub WebX1_CallFunction(Index As Integer, FunctionName As String)
  572. ' Index - The connection number that requested the function. Index has to be
  573. '         passed back to WebX when using the .ReturnData method.
  574. ' sFunctionName -  The name of the function called from HTML.
  575. ' sQueryString - The Query String passed to the page. You can also use
  576. '                .QueryStringCount and .QueryString to enumerate and
  577. '                retrieve individual values using WebX.
  578.   On Error GoTo eh
  579.   ' In the Demo App we use the Select statement to decide which function
  580.   ' to call. This allows the Function name in the HTML to be different
  581.   ' than the App function name.
  582.   ' As seen below, "MyFunction" is the name of the function in HTML, but
  583.   ' the name of the VB function actaully called is "TestFunction"
  584.   Select Case FunctionName
  585.       Case "MyFunction"
  586.           WebX1.ReturnData Index, TestFunction()
  587.         
  588.       Case "MyBadFunction"
  589.           WebX1.ReturnData Index, TestFunctionError()
  590.         
  591.       Case Else
  592.           ' If the function does not exists, send something back, either ""
  593.           ' or a message saying that the function was not found. This will
  594.           ' depend if errors should be masked (hidden) from users, or if they
  595.           ' should be exposed to the user.
  596.           
  597.           'WebX1.ReturnData Index, ""
  598.           WebX1.ReturnData Index, "Error: The Function Call failed. Function " & _
  599.                                 FunctionName & " was not found."
  600.         
  601.   End Select
  602. Exit Sub
  603.   ' Remember we are sending back HTML
  604.   WebX1.ReturnData Index, "There has been an error in Function " & FunctionName & "." & _
  605.                        "<br><br>[Error Location: " & Err.Source & "]" & _
  606.                        "[Error Number: " & Err.Number & "]" & _
  607.                        "[Error Description: " & Err.Description & "]"
  608.                        
  609. End Sub
  610. Public Function TestFunction()
  611. ' Return some sample HTML, but this could really be anything. You could
  612. ' get some roWebX1 from a database, format them in a table and send them back.
  613. ' If you do format then, keep it simple, let as much of the 'flash' be written
  614. ' into in the HTML file. Note the use of line numbers to help in debugging.
  615. 10000  On Error GoTo eh
  616. 10001  Dim sTemp As String
  617. 10002  sTemp = "<font face=""Verdana"" size=""2"" font color=#FF0000>This is HTML that was called from the function TestFunction in the Test Application.</font>" & vbCrLf
  618. 10003  sTemp = sTemp & "<BR>" & vbCrLf
  619. '10004  sTemp = sTemp & "Passed String = " & sQS & vbCrLf
  620. 10005  sTemp = sTemp & "<BR>" & vbCrLf
  621.        'Uncomment to force an error for testing
  622. 10006  'sTemp = 4 / 0
  623. 10007  TestFunction = sTemp
  624. Exit Function
  625.     Err.Raise Err.Number, "TestFunction::" & Erl, Err.Description
  626. End Function
  627. Public Function TestFunctionError()
  628. ' This is the same function TestFunction, but we are forcing an error to
  629. ' test error handling.
  630. 10000  On Error GoTo eh
  631. 10001  Dim sTemp As String
  632. 10002  sTemp = "<font face=""Verdana"" size=""2"" font color=#FF0000>This is HTML that was called from the function TestFunction in the Test Application.</font>" & vbCrLf
  633. 10003  sTemp = sTemp & "<BR>" & vbCrLf
  634. 10004  sTemp = sTemp & "Forcing an error here, to test Error Handling." & vbCrLf
  635. 10005  sTemp = sTemp & "<BR>" & vbCrLf
  636. 10006  sTemp = 4 / 0
  637. 10007  TestFunctionError = sTemp
  638. Exit Function
  639.     Err.Raise Err.Number, "TestFunctionError::" & Erl, Err.Description
  640. End Function
  641.