Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
mxck Newbie Joined: 30/07/2020 Location: New ZealandPosts: 9
Posted: 11:13am 03 Aug 2020
Copy link to clipboard
Print this post
Hi all,
I was reading through the manual and noticed the PIXEL command allows either a single value or arrays to be passed into it to draw pixels. Would it be fair to assume using the array version of it is faster than calling the command separately every time?
When trying to use it I wasn't quite sure how it would work. Here's a tiny program that I expected to work. Your help is much appreciated!
Mx.
mode 3, 16
dim integer x(1) = (0, 10) dim integer y(1) = (20, 30)
color rgb(green) pixel x, y
do loop
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10215
Posted: 11:19am 03 Aug 2020
Copy link to clipboard
Print this post
Like all commands when passing arrays you need brackets on the variable
mode 3, 16
dim integer x(1) = (0, 10) dim integer y(1) = (20, 30)
color rgb(green) pixel x(), y()
do loop
Most drawing commands allow arrays and it can make a HUGE difference to performance Edited 2020-08-03 21:19 by matherp
mxck Newbie Joined: 30/07/2020 Location: New ZealandPosts: 9