got_bascom
Joined: 23 Feb 2015 Posts: 12
|
Posted: Sun Mar 01, 2015 11:11 pm Post subject: Monitoring loading floating values into array with simulator |
|
|
Hi Gang,
I have an array that I am loading with floating point values using a lookup.
I'm using a for-loop to iterate through them.
The strange thing is, when I watch it working in the simulator, the 0 element of the array doesn't get loaded
until the 1st one is pulled from the lookup, and then the 0 element gets loaded with the value for the 1st element.
I'm using Misc_single (below) as an additional way of viewing the values.
Freqarray(0) should be 1.8
Freqarray(1) should be 3.5
Freqarray(2) should be 7.0
Look at the screen-shot and see that the simulator shows Freqarray(0) and Freqarray(1) to have the same value.
Am I doing something wrong?
Dim Misc_single As Single
Dim Freqarray(11) As Single
'Setup the frequencies into Freqarray
For X = 0 To 10
S = Lookupstr(x , Bandfreq)
Misc_single = Val(s)
Freqarray(x) = Misc_single
Next X
End
Bandfreq:
Data "1.8" , "3.5" , "7.0" , "10.10" , "14" , "18.068" , "21" , "24" , "28" , "29.7" , "5"
(BASCOM-AVR version : 2.0.7.5 , Latest : 2.0.7.8 ) |
|