s0lusek
New member
- Joined
- Feb 1, 2015
- RedCents
- 20¢
I'm getting consistent crashes and I'm completely unable to pinpoint what's going on. It's incredibly frustrating that it's crashing instead of just throwing macro errors to the output window now. It makes it very difficult to debug. Would someone mind skimming this and telling me whether I'm perhaps, misusing any TLO that have changed or anything? I went through all of the change logs for the past 12 months and can't find anything that indicates this code is misusing any major components.
Rich (BB code):
|----------------------------
Sub IndexThisString(string strStringToIndex,int intSegmentsToIndex)
|----------------------------
|receives a string and breaks it up using a break character(_), then sets each segment
|as an outer variable accessible by other macros. To ensure these variables aren't used
|erroneously without being wiped they are cleaned when this macro is called.
|clean vars
/varset strWorkingString ""
/varset n 0
/varset intIndexBreak[9] 0
/varset strIndexPart[9] 0
|Indexing Loop
/varset strWorkingString ${strStringToIndex}
/for n 1 to ${intSegmentsToIndex}
/delay 0.5
/if (${n} < ${intSegmentsToIndex}) {
/varset intIndexBreak[${n}] ${strWorkingString.Find[_]}
/varset strIndexPart[${n}] ${strWorkingString.Left[${Math.Calc[${intIndexBreak[${n}]}-1]}]}
/varset strWorkingString ${strWorkingString.Right[-${intIndexBreak[${n}]}]}
} else /if (${n} == ${intSegmentsToIndex}) {
/varset strIndexPart[${n}] ${strWorkingString}
}
/next n
/return

