Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

DIM or LOCAL

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
dw

Bascom Member



Joined: 22 Feb 2005
Posts: 15

PostPosted: Thu Feb 24, 2005 9:31 am    Post subject: DIM or LOCAL Reply with quote

Code:
Declare Sub Foo

Foo

Sub Foo
Dim Long_a As Long
Local Long_b As Long
Local Word_c As Word

Word_c = Long_a / 2                                         ' OK: Global Long Var used
Word_c = Long_b / 2                                         ' ERROR: Local Long Var used

End
End Sub


When using the local long variable you got a 242 Error (Source does not match taget var)
Using the global one is ok
Does any one knows why? Bug or feature?

Thanks for help!

Cu, Dw
Back to top
View user's profile
oe9vfj

Moderator



Joined: 17 Jun 2004
Posts: 269
Location: Austria, Hard

austria.gif
PostPosted: Thu Feb 24, 2005 10:31 am    Post subject: Reply with quote

Hi,

Mixing Long and Word variable in one operation isn't supported (yet), when they have different scope (Local, or Global)

_________________
regards Josef

DOS - File System for BASCOM-AVR on http://members.aon.at/voegel
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive 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