With 145 downloads, the Jan 2 version got a bit stale, so I guess it's time for an update.
Many improvements "under the hood", but also some visible goodies; inter alia, all arrays (strings, byte/word/dword, REAL4/8/10, structures) can now be dynamically defined, e.g.
Dim My
$() Dim NormalDist
() As DWORD
Dim Sinus
() As REAL8
Note though, that values can be assigned only incrementally, e.g.
Dim My
$() Let My$(99)="Hello"
; illegal, will throw an error xor ecx, ecx
.Repeat
Let My$(ecx)=Str$("#%i", ecx)
inc ecx
.Until ecx>9999
The deb macro has learned to display flags (without changing them, of course):
deb 4, "End of loop:", ecx, flags, FLAGS
flags displays carry, zero, sign and overflow, FLAGS the whole set:
End of loop:
ecx 10000
flags: czso
FLAGS: cpAzstIdoc means carry clear, C carry set, etc.
Last but not least, attached a minimally modified \Masm32\examples\exampl01\generic\generic.asm:
1. Includes were replaced by the usual one-liner: include \masm32\MasmBasic\MasmBasic.inc
2. These few lines were added below "end menu commands":
;====== end menu commands ======
.elseif uMsg == WM_CREATE
ToolTips start ; we'd like to see the country names
ToolTips end
Dim NormalDist() As DWORD ; read the data of a normal distribution from file
ArrayRead NormalDist(), "NormalDist.dat"
ArrayLoadMap 0, "Europe" ; load a map
Dim Sinus() As REAL8 ; define an array for a sinus curve
xor ecx, ecx
push 180
fild stack ; stack is an equate for dword ptr [esp]
push ecx
fldpi
fdivr
fstp REAL4 PTR stack[4]
.Repeat
mov stack, ecx
fild stack
fmul REAL4 PTR stack[4]
fsin
fstp Sinus(ecx)
inc ecx
.Until ecx>500
pop ecx
pop eax
.elseif uMsg == WM_MOUSEMOVE
ArrayMapRegion(lParam, 0, hWnd)
.elseif uMsg == WM_PAINT
ArrayPlot hWnd, RgbCol(200, 255, 240) ; init with window (or control) handle and background colour
ArrayPlot 0, RgbCol(200, 200, 200), lines:2 ; plot map 0 as loaded above, with grey border and 2px lines
ArrayPlot Sinus() ; plot the sinus curve defined above
ArrayPlot NormalDist()
; ------ here you could add additional features, e.g. a legend ------
ArrayPlot exit, "Europe" ; finish with a title
.elseif uMsg == WM_CLOSEThe output? Check yourself

P.S.: With more recent MasmBasic versions, replace the
start: label with
Init, otherwise it will crash.