04-27-2024, 02:28 PM
So I literally have over 7000 lines of code and just recently changed the value of a variable from a whole number to a decimal value. I'm now getting some strange results but can't seem to find which routine is causing the problem.
Before entering a Sort routine I had a variable QS, which could carry a value between 1 and 4 depending on which of 4 arrays I was directing to the QuickSort. I found that the array which was identified at #2, needed to be broken down to two different sorts so rather than redo all the QS numbers for the 4 arrays I simply changed #2 to 2.1 and 2.2. The code run sorts all the time and keeps track of how many sorts are being performed (mostly to see how I can improve things)
When I ran the code everything worked fine , QS = 2.1 and QS = 2.2 were sorting ok until sort # 42. From sort # 42 and onwards, QS would not recognize the decimal values but somehow QS = 2 returned. It appears as if the 2.1 and 2.2 values of QS dropped off and QS from sort #42 an onwards became = to 2
I'm having trouble finding where this change in value occurred. It's not showing up in a simple search where I may have inadvertently use 2 rather than 2.1 or 2.2 so it must be in something like a Select Case where the Cases will not recognize anything other than the whole number, or maybe an IF statement or a Loop statement or some kind of an Assignment statement which only deals with integers. I do have multiple nested IF's and Loops.
I realize the simple solution is to go back, do not change #2 to 2.1 and 2.2 but just create a 5th and I will do this but if I can figure out why, after 42 sorts the decimal value is dropped then either I won't do that again or I can get the program back on track with a simple change of something at sort #42.
You guys have any thoughts on what command/function/routine that will only recognize a variable as an integer?
Before entering a Sort routine I had a variable QS, which could carry a value between 1 and 4 depending on which of 4 arrays I was directing to the QuickSort. I found that the array which was identified at #2, needed to be broken down to two different sorts so rather than redo all the QS numbers for the 4 arrays I simply changed #2 to 2.1 and 2.2. The code run sorts all the time and keeps track of how many sorts are being performed (mostly to see how I can improve things)
When I ran the code everything worked fine , QS = 2.1 and QS = 2.2 were sorting ok until sort # 42. From sort # 42 and onwards, QS would not recognize the decimal values but somehow QS = 2 returned. It appears as if the 2.1 and 2.2 values of QS dropped off and QS from sort #42 an onwards became = to 2
I'm having trouble finding where this change in value occurred. It's not showing up in a simple search where I may have inadvertently use 2 rather than 2.1 or 2.2 so it must be in something like a Select Case where the Cases will not recognize anything other than the whole number, or maybe an IF statement or a Loop statement or some kind of an Assignment statement which only deals with integers. I do have multiple nested IF's and Loops.
I realize the simple solution is to go back, do not change #2 to 2.1 and 2.2 but just create a 5th and I will do this but if I can figure out why, after 42 sorts the decimal value is dropped then either I won't do that again or I can get the program back on track with a simple change of something at sort #42.
You guys have any thoughts on what command/function/routine that will only recognize a variable as an integer?