Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

How to print a array?

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

Bascom Member



Joined: 07 Jul 2011
Posts: 114

PostPosted: Thu Jul 25, 2019 5:24 pm    Post subject: How to print a array? Reply with quote

Please try it in Simulator

$regfile = "m48def.dat" ' specify the used micro
$crystal = 4000000 ' used crystal frequency
$baud = 9600 ' use baud rate
$hwstack = 40 ' default use 32 for the hardware stack
$swstack = 40 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space

Dim Array(5) As Byte
const k = 5

Array(1) = 1 : Array(2) = 2 : Array(3) = 3 : Array(4) = 4 : Array(5) = 5
Print "print array " ; Array(1) ; 5

Print "print array " ; Array(1) ; k

'It not work, what i make wrong

Regards
P_Santos

(BASCOM-AVR version : 2.0.8.1 , Latest : 2.0.8.1 )
Back to top
View user's profile
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 58

germany.gif
PostPosted: Thu Jul 25, 2019 5:54 pm    Post subject: Reply with quote

The Fastest solution is

Print array(1)
Print array(2)
Print array(3)
Print array(4)
Print array(5)

or

Dim array(5) as byte , A as byte

For A=1 to 5

Print "Print Array" ; array(A)

Next
Embarassed
Back to top
View user's profile
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1135

poland.gif
PostPosted: Thu Jul 25, 2019 7:52 pm    Post subject: Reply with quote

Check topic "Printbin" in the help.
https://wiki.mcselec.com/bavr/PRINTBIN

Code:
Printbin Array(1) 'whole array will be sent if not specified
Back to top
View user's profile Visit poster's website
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