Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Change in PRINT in 2.0.6.0?

 
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
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 526

blank.gif
PostPosted: Sat May 28, 2011 11:56 pm    Post subject: Change in PRINT in 2.0.6.0? Reply with quote

The following worked fine in 2.0.5.0 and earlier:

Code:

$regfile = "m128def.dat"
$crystal = 16000000
$hwstack = 800                                              '100
$swstack = 500                                              '200
$framesize = 300                                            '600
$Baud = 9600

Dim TestString As String * 10


 Print "VM " + TestString + ",0" + Chr(13) ;

 End
 


Under 2.0.6.0, it reports this error when compiling

Error : 42 Line : 12 Numeric parameter expected ["VM] , in File : C:\MCS Electronics\BASCOM-AVR\testprint.bas
Error : 31 Line : 12 Invalid datatype [[0011] 0[13)]] , in File : C:\MCS Electronics\BASCOM-AVR\testprint.bas

I assume it's the CHr(13) ?

( I see nothing in the history file nor the new HELP file that would explain this change)
Back to top
View user's profile
hgrueneis

Bascom Member



Joined: 04 Apr 2009
Posts: 906
Location: A-4786 Brunnenthal

austria.gif
PostPosted: Sun May 29, 2011 7:08 am    Post subject: Reply with quote

There is nothing in the Help file that would suggest the use of a plus sign (at least I can not find any).
If you replace it with a semicolon then it works.
It also works if you use a separate print command for CHR(X).
Hubert
Back to top
View user's profile
mattcro

Bascom Member



Joined: 03 Oct 2007
Posts: 327
Location: Scotland

uk.gif
PostPosted: Sun May 29, 2011 3:31 pm    Post subject: Reply with quote

This change in behaviour may be due to a bug fix related to strings:

History.txt for 2.0.6.0
- using {034} and quotes gave a problem when they were unbalanced.

The correct way to print multiple variables is to use the semicolon. The contatenation (plus sign) seems to give odd results sometimes.

_________________
If all else fails, read the manual. Even better: read the manual before something fails. If you can't find it in the manual, search the forum.
BascomAVR 2.0.8.5
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6198
Location: Holland

blank.gif
PostPosted: Tue May 31, 2011 10:48 pm    Post subject: Reply with quote

indeed the correct way is to use semicolon, but i changed it so + will work as well. this will keep code compatible.
_________________
Mark
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