I have a code (which I've posted below) that is reading in a text file (posted below the code below). The expected result for misc(21) to be displayed by the message box is "". This result is displayed by the msg box when this code is stepped through using F8. If the code is run normally using F5, a different (incorrect) string is displayed by the msg box. The following is displayed
It reads: "Output Path: (Same as Main Directory Path)........." but it should be "".
The file it's reading in is:
I don't understand why I am getting different results when running the code differently? Thanks,
It reads: "Output Path: (Same as Main Directory Path)........." but it should be "".
Code:
'[Currently the form is set up to pull from only one model]
Option Explicit
Public ModelPath1 As String
Public modelPath2 As String
Public forceOutputPath As String
Public numberGroups As Long
Public numGroups As Long
Public groupINT As Long
Public groupName As String
Public IsGroupSelected As String
Public currentPath As String
Public InfoInputData As String
Public numModel As Long
Public HorzAvgDist As Single
Public VertAvgDist As Single
Public fy As Single
Public globalScaleFactor As Single
Public Sv As Single
Public IC As Single
Public groupListInput As String
Public groupListArr
Public skewTol As Single
Public xShearFactor As Single
Public yShearFactor As Single
Public Sub ReadInData()
'[This routine is used to read everything in except group information]
Dim misc() As String
Dim Fnum As Long
Fnum = FreeFile()
currentPath = ActiveWorkbook.Path
ReDim misc(1 To 29)
InfoInputData = currentPath & "\WKBK1 Form Data\" & "Copy of InfoInputData-new.txt"
'[Read in data to initialize textboxes
Open InfoInputData For Input As #Fnum
Input #Fnum, misc(1), numModel, misc(2), misc(3), HorzAvgDist, misc(4), misc(5), VertAvgDist
Input #Fnum, misc(6), misc(7), fy, misc(8), misc(9), globalScaleFactor, misc(10), misc(11)
Input #Fnum, Sv, misc(12), misc(13), IC, misc(14), misc(15), skewTol, misc(26), misc(27), xShearFactor, misc(28), misc(29), yShearFactor
Input #Fnum, misc(16), misc(17), misc(18), ModelPath1, modelPath2, misc(19), misc(20), forceOutputPath
Input #Fnum, misc(21), misc(22), numberGroups, misc(23), misc(24), misc(25)
Close #Fnum
The file it's reading in is:
HTML:
//Number of Models://
2
//Horizontal distance to interpolate from edge of opening [ft]//
1
//Vertical distance to interpolate from edge of opening [ft]//
2
//Reinforcing Steel yield strength fy [ksi]//
3
//Global scale up factor//
4
//Sv durability factor//
5
//Maximum IC factor//
6
//Element Skew Tolerance//
100
//X-direction In-plane shear factor//
1.2
//Y-direction In-plane shear factor//
1.8
//Model File Paths: (If only one model is used second model line is blank)//
//Static model path is first and dynamic model path is second//
D:\CMRR Post Processing\CMRR VBA\Model\V & V Model (Sloped Roof)_run6.SDB
D:\CMRR Post Processing\CMRR VBA\Model\V & V Model (Sloped Roof)_run6.SDB
//Force Output Path: (Same as Main Directory Path)//
D:\
//Number of Groups In Model://
5
//Groups Information://
//(Group Number; Group is Run (T/F); fc[ksi]; top cover [in]; botttom cover [in])//
11001,True,1,1,1
11002,False,2,2,2
11500,True,3,3,3
12001,False,4,4,4
12305,True,4,3,3
I don't understand why I am getting different results when running the code differently? Thanks,