P positrom2 Active Member Licensed User Longtime User Apr 20, 2013 #1 The following code snippet Code: Copy 852 Dim mittelwert As Double, streuung As Double, s As Double For j=2 To steps-1 s=s+maxr_array(j,0) Next mittelwert=s/(steps-2) s=0 For j=2 To steps-1 s=mittelwert-maxr_array(j,0) s=s+Power(s,2) Next streuung=Sqrt(s/(steps-2)) throws the error Error description: Current declaration does not match previous one. Previous: {Type=Float,Rank=0} Current: {Type=Double,Rank=0} Occurred on line: 852 Dim mittelwert As Double, streuung As Double, s As Double Word: , Click to expand... Those variables are not declared elsewhere. Thanks, positrom2
The following code snippet Code: Copy 852 Dim mittelwert As Double, streuung As Double, s As Double For j=2 To steps-1 s=s+maxr_array(j,0) Next mittelwert=s/(steps-2) s=0 For j=2 To steps-1 s=mittelwert-maxr_array(j,0) s=s+Power(s,2) Next streuung=Sqrt(s/(steps-2)) throws the error Error description: Current declaration does not match previous one. Previous: {Type=Float,Rank=0} Current: {Type=Double,Rank=0} Occurred on line: 852 Dim mittelwert As Double, streuung As Double, s As Double Word: , Click to expand... Those variables are not declared elsewhere. Thanks, positrom2
klaus Expert Licensed User Longtime User Apr 20, 2013 #2 You must have declared one of the variables somewhere else. Best regards. Upvote 0
P positrom2 Active Member Licensed User Longtime User Apr 20, 2013 #3 You must have declared one of the variables somewhere else. Click to expand... No, using "show all references" does not reveal additional declaration of any of those three variables. The error message also is looking strange. Being stumped (ratlos). positrom2 Upvote 0
You must have declared one of the variables somewhere else. Click to expand... No, using "show all references" does not reveal additional declaration of any of those three variables. The error message also is looking strange. Being stumped (ratlos). positrom2
grant1842 Active Member Licensed User Longtime User Apr 20, 2013 #4 Is there any way you could post your project? I had a similar issue before. I would have for example: Dim I as Int Then many lines of code later I would have Dim I as Double Both in the same Sub. The compiler would gripe and say the same thing you're getting. Upvote 0
Is there any way you could post your project? I had a similar issue before. I would have for example: Dim I as Int Then many lines of code later I would have Dim I as Double Both in the same Sub. The compiler would gripe and say the same thing you're getting.
P positrom2 Active Member Licensed User Longtime User Apr 21, 2013 #5 Solved: "Dim mittelwert" indeed occured twice as suggested by Klaus. To my favor I found that "find all references" does not list all references (just the most adjacent "Dim" statement) (B4A 2.52). I also observed earlier that "find all references" occasionally was refusing to list the "Dim" of a variable (even it is occuring just once). So the "all" is somewhat misleading. Suggestion: should be removed. positrom2 Upvote 0
Solved: "Dim mittelwert" indeed occured twice as suggested by Klaus. To my favor I found that "find all references" does not list all references (just the most adjacent "Dim" statement) (B4A 2.52). I also observed earlier that "find all references" occasionally was refusing to list the "Dim" of a variable (even it is occuring just once). So the "all" is somewhat misleading. Suggestion: should be removed. positrom2