Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:18 15 Feb 2026 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : Why this error (PicoMite)?

Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3609
Posted: 06:03pm 14 Feb 2026
Copy link to clipboard 
Print this post

> run
[47] Line SX(-24), SY(34), SX(24), SY(34), 1, cTrack
Error : Dimensions

Error doesn't occur when SX parameter is not negative.
> Line SX(0), SY(34), SX(24), SY(34), 1, cTrack

(Above command correctly draws line)

=======================

> list
Option Explicit
Option Default Float

Dim Float Scale
Dim Integer OffX, OffY

' --- Color Palette ---
Dim Integer cTrack  = RGB(255, 255, 255)

' --- Setup & Draw ---
InitScale
CLS RGB(0, 0, 0)

DrawMainline

' Keep program running to hold display
Do
Loop

' ====================================================================
' RENDERING ENGINE
' ====================================================================

Sub InitScale
Local Float scaleX = MM.HRES / 100.0
Local Float scaleY = MM.VRES / 90.0

If scaleX < scaleY Then Scale = scaleX Else Scale = scaleY

OffX = (MM.HRES - (96 * Scale)) / 2
OffY = (MM.VRES - (72 * Scale)) / 2
End Sub

Function SX(x As Float) As Integer
SX = OffX + (x + 48) * Scale
End Function

Function SY(y As Float) As Integer
SY = OffY + (36 - y) * Scale
End Function

' ====================================================================
' GEOMETRY DRAWING
' ====================================================================

Sub DrawMainline
Line SX(-24), SY(34), SX(24), SY(34), 1, cTrack
Line SX(-24), SY(-34), SX(24), SY(-34), 1, cTrack

Line SX(-46), SY(12), SX(-46), SY(-12), 1, cTrack
Line SX(46), SY(12),  SX(46), SY(-12), 1, cTrack

End Sub
>


~
Edited 2026-02-15 04:05 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10953
Posted: 07:00pm 14 Feb 2026
Copy link to clipboard 
Print this post

It first assumes sx is an array and fails on the negative array index. I'll fix in the next beta
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026