Sorry my mistake. The file I was loading into the program was only a piece of the file. lol So it does actaully load fully. But when I edit the file with the multiplier, it locks up. So, instead of making it try to change all 1500+ variables at once, would it be smarter to put this in a loop so it changes one by one? Maybe with a progress bar?
VB Code:
Public Sub ChangeValue(pvarName As String, pMultiply As Long) Dim lposVar As Long Dim lposValue As Long Dim lposEndLine As Long Dim lValue As Long Dim lNewValue As Long lposVar = InStr(1, txtScript.Text, pvarName) 'Get the position of the Variable lposequalsign = InStr(lposVar, txtScript.Text, "=") 'get the position of = sign lposEndLine = InStr(lposequalsign, txtScript.Text, vbNewLine) 'Get the end of the line position lValue = CLng(Mid$(txtScript.Text, lposequalsign + 1, lposEndLine - lposequalsign)) 'Get your Value lNewValue = lValue * MultiValue txtScript.Text = Replace(txtScript.Text, pvarName & "=" & CStr(lValue), pvarName & "=" & CStr(lNewValue)) End Sub




Reply With Quote