I am making a library that will load UI files in which a user can customize the UI of the program.
The UI file is arranged that it is like vb code and that to set the text and location of a button the user would use the following UI code.
button1.text = "Hello My Name Is MRClark" button1.top=10 button1.left=15
In a library that i have made to read and intrepret this code, i am encountering an error, that i send the function a strign to look for "button1.text" as it goes through all lines of the code. However, when going through step by step, even once the string that i have entered is equal to the code in the line of the file, it goes to endif, as is they were not equal.
Function GetValue(ByVal ValueToGet As String, Optional ByVal ValueAsInteger As Boolean = False) ValueToGet = ValueToGet.ToLower 'UIText is defined earlier in the program and is the string of each line in the file being read. 'LineText(X) is each line split into its parts at the = sign Try For x = 0 To 3000 LineText = UIText(10).Split("=") LineText(0) = LineText(0).ToLower LineText(0) = LineText(0).Replace(" ", "") 'In the following line, even if the two values are equal, it goes directly to EndIf If ValueToGet = LineText(0) Then 'NOT WORKING!!!! ARG!!! If ValueAsInteger = True Then Dim ValueToReturn As String ValueToReturn = LineText(1).Replace(" ", "") Return Val(ValueToReturn) Else Dim ValueToReturn(2) As String ValueToReturn = LineText(1).Split(Chr(34)) Return ValueToReturn(1) End If End If Next Catch Return "Value Not Found" End Try End Function
Any and all help is greatly appreciated, as i have hit a wall..