The following worked several versions back:
Function CountUnmarked% (KSorCC$)
CountUnmarked% = 0
If KSorCC$ = "KS" Then
For x = 1 To TotKSrecs%
If KSdata$(Assigned%, x) = "N" Then CountUnmarked% = CountUnmarked% + 1
Next x
Else
For x = 1 To TotCCrecs%
If CCdata$(Assigned%, x) = "N" Then CountUnmarked% = CountUnmarked% + 1
Next x
End If
End Function
With PE edition, you cannot use the variable CountUnmarked% the same as you would any other variable (within the function). It appears that QB64 thinks that you are calling the function again. Instead you have to use a temp variable and then assign that value to CountUnmarked% before exiting the function:
Function CountUnmarked% (KSorCC$)
tCountUnmarked% = 0
If KSorCC$ = "KS" Then
For x = 1 To TotKSrecs%
If KSdata$(Assigned%, x) = "N" Then tCountUnmarked% = tCountUnmarked% + 1
Next x
Else
For x = 1 To TotCCrecs%
If CCdata$(Assigned%, x) = "N" Then tCountUnmarked% = tCountUnmarked% + 1
Next x
End If
CountUnmarked% = tCountUnmarked%
End Function
Is this because recursion code changed ? I can make adjustments if this is proper operation, no biggie. I just wanted to mention this in case is this is a bug...<ahem>...errr...an 'undocumented feature'.
Thanks to all,
Dano
Function CountUnmarked% (KSorCC$)
CountUnmarked% = 0
If KSorCC$ = "KS" Then
For x = 1 To TotKSrecs%
If KSdata$(Assigned%, x) = "N" Then CountUnmarked% = CountUnmarked% + 1
Next x
Else
For x = 1 To TotCCrecs%
If CCdata$(Assigned%, x) = "N" Then CountUnmarked% = CountUnmarked% + 1
Next x
End If
End Function
With PE edition, you cannot use the variable CountUnmarked% the same as you would any other variable (within the function). It appears that QB64 thinks that you are calling the function again. Instead you have to use a temp variable and then assign that value to CountUnmarked% before exiting the function:
Function CountUnmarked% (KSorCC$)
tCountUnmarked% = 0
If KSorCC$ = "KS" Then
For x = 1 To TotKSrecs%
If KSdata$(Assigned%, x) = "N" Then tCountUnmarked% = tCountUnmarked% + 1
Next x
Else
For x = 1 To TotCCrecs%
If CCdata$(Assigned%, x) = "N" Then tCountUnmarked% = tCountUnmarked% + 1
Next x
End If
CountUnmarked% = tCountUnmarked%
End Function
Is this because recursion code changed ? I can make adjustments if this is proper operation, no biggie. I just wanted to mention this in case is this is a bug...<ahem>...errr...an 'undocumented feature'.
Thanks to all,
Dano