VERSION 5.00 Begin VB.Form FrmSaveAsBrownBridge Caption = "Save Brownian Bridge Output As..." ClientHeight = 5370 ClientLeft = 60 ClientTop = 345 ClientWidth = 6000 LinkTopic = "Form1" ScaleHeight = 5370 ScaleWidth = 6000 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton CmdSave Caption = "Save Output" Height = 495 Left = 2040 TabIndex = 9 Top = 4680 Width = 1455 End Begin VB.ComboBox CmboFileType Height = 315 Left = 1680 TabIndex = 8 Text = "text (comma delimited) (*.txt)" Top = 4080 Width = 2535 End Begin VB.TextBox TxtSaveAs Height = 285 Left = 1680 TabIndex = 5 Text = "BrowninanBridge" Top = 3360 Width = 2295 End Begin VB.DriveListBox DrvFile Height = 315 Left = 1680 TabIndex = 1 Top = 0 Width = 1215 End Begin VB.DirListBox DirFile Height = 2565 Left = 1680 TabIndex = 0 Top = 480 Width = 3135 End Begin VB.Label LblSaveType Caption = "Save file as type: " Height = 255 Left = 0 TabIndex = 7 Top = 4080 Width = 1215 End Begin VB.Label Label1 Caption = "Save file in drive:" Height = 255 Left = 0 TabIndex = 6 Top = 0 Width = 1455 End Begin VB.Label LblLookIn Caption = "Save to drive:" Height = 255 Left = 0 TabIndex = 4 Top = 0 Width = 1095 End Begin VB.Label LblDirectory Caption = "Save in directory:" Height = 255 Left = 0 TabIndex = 3 Top = 600 Width = 1335 End Begin VB.Label LblFile Caption = "Save file as:" Height = 255 Left = 0 TabIndex = 2 Top = 3360 Width = 1455 End End Attribute VB_Name = "FrmSaveAsBrownBridge" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub dirFile_Change() Path = DirFile.Path End Sub Private Sub drvFile_Change() DirFile.Path = DrvFile.Drive End Sub Private Sub CmdSave_Click() If CmboFileType.Text = "text (comma delimited) (*.txt)" Then extension = ".txt" separator = "," Else If CmboFileType.Text = "text (tab delimited) (*.txt)" Then extension = ".txt" separator = vbTab End If End If SaveFile = CStr(TxtSaveAs.Text) SaveFileFullName = DirFile.Path & "\" & SaveFile & extension If SaveFileType = "BBGrid" Then Open SaveFileFullName For Output As #1 Print #1, "X" & separator & "Y" & separator & "Probability" For I = 0 To GridDimension - 1 For j = 0 To 2 BBProbGridArray(I, j) = Round(BBProbGridArray(I, j), 9) If j = 2 Then Print #1, BBProbGridArray(I, j) & vbCrLf; Else Print #1, BBProbGridArray(I, j) & separator; End If Next j Next I Close MsgBox "Browninan Bridge Grid File Saved" & SaveFileFullName Else If SaveFileType = "RoadBB" Then Open SaveFileFullName For Output As #2 Print #2, "X" & separator & "Y" & separator & "ProbabilityDensity" For I = 0 To NumOfRoadVerts - 1 For j = 0 To 2 If j = 2 Then Else ProbDensityAtVertexArray(I, j) = Round(ProbDensityAtVertexArray(I, j), 9) End If If j = 2 Then Print #2, ProbDensityAtVertexArray(I, j) & vbCrLf; Else Print #2, ProbDensityAtVertexArray(I, j) & separator; End If Next j Next I Close MsgBox "Road Browninan Bridge File Saved" & SaveFileFullName End If End If Call Unload(FrmSaveAsBrownBridge) Call Load(FrmBBAnalysis) End Sub Private Sub Form_Load() CmboFileType.AddItem "text (comma delimited) (*.txt)" CmboFileType.AddItem "text (tab delimited) (*.txt)" End Sub