PicoMite 6.00.02 prospectus


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4398
Posted: 07:31pm 15 Jan 2025      

  vegipete said  Suppose there were a preprocessor. Then we could
#define ByVal 0+
plus many other silly things.


This works in MMB4L:
MMBasic for Linux x86_64 v0.7-alpha.1
Copyright 2011-2024 Geoff Graham
Copyright 2016-2024 Peter Mather
Copyright 2021-2024 Thomas Hugo Williams

> load "byval.bas"
> list
#define "ByVal", "0+"

a%=7
Print double(ByVal a%)
Print a%
Print double(a%)
Print a%

Function double(i%)
i%=i%*2
double=i%
End Function

> run
14
7
14
14
>


It should also work on the CMM2, MMBasic for Windows, and possibly the PicoMite using the "CMM2 RUN" command.

Best wishes,

Tom
Edited 2025-01-16 05:46 by thwill