![]() |
Forum Index : Microcontroller and PC projects : Can you (would you) += in MMBasic
![]() ![]() |
|||||
Author | Message | ||||
stanleyella![]() Guru ![]() Joined: 25/06/2022 Location: United KingdomPosts: 2527 |
greatcowbasic lets you use a++ instead of a=a+1 also a--- instead of a=a-1 but a++b instead of a=a+b would be better. inc is ok. what if it's float? |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1638 |
Thanks Geoff, I don't think the good old Micromite is fully appreciated by many of the newer shedders and many could learn a lot from reading the articles on your website. @Stan Easy enough to test: ![]() Bill Keep safe. Live long and prosper. |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3348 |
You get a more reasonable result of 2.25 if you include the comma before 0.5 PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1638 |
Doh! Thanks Lizby without the comma it is just incrementing by one and ignoring the 0.5. I wasn't paying proper attention. Bill Keep safe. Live long and prosper. |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 424 |
If you wanted to do that, it would be better to follow what official BASIC already uses: MAT READ a DATA 202,80,50,60,0,0,0 Edited 2024-01-20 14:52 by toml_12953 |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1638 |
Dim a(6) = (202,80,50,60,0,0,0) > list Dim a(6) = (202,80,50,60,0,0,0) For b = 0 To 6 : Print a(b): Next > run 202 80 50 60 0 0 0 > Note: zero base array Bill Keep safe. Live long and prosper. |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |