Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Monitoring loading floating values into array with simulator

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
got_bascom

Bascom Member



Joined: 23 Feb 2015
Posts: 12

PostPosted: Sun Mar 01, 2015 11:11 pm    Post subject: Monitoring loading floating values into array with simulator Reply with quote

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 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Sun Mar 01, 2015 11:18 pm    Post subject: Reply with quote

check out CONFIG BASE in the help. And also, read the PDF manual. It contains a lot of info.
You should at least read Language Fundamentals.

_________________
Mark
Back to top
View user's profile Visit poster's website
got_bascom

Bascom Member



Joined: 23 Feb 2015
Posts: 12

PostPosted: Mon Mar 02, 2015 1:25 am    Post subject: Reply with quote

Thanks Mark.
That explains it.
I'll try harder to dig for the answers in the help files.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum