array.bas
来自「smallbasic for linux」· BAS 代码 · 共 32 行
BAS
32 行
#!/ndc/palm/SmallBASIC/sbrun? cat(1);"TEST:";cat(0);" Arrays, unound, lbound"dim m(1 to 3, -1 to 1)m(1, -1) = 1m(2, 0) = 2m(3, 1) = 3if m(1,-1)<>1 then ? "ERR 1"if m(2,0)<>2 then ? "ERR 2"if m(3,1)<>3 then ? "ERR 3"for i=1 to 3 for j=-1 to 1 m(i,j)=(i*10)+j nextnextfor i=1 to 3 for j=-1 to 1 if m(i,j)<>(i*10)+j then ? "ERROR (";i;",";j;")" fi nextnextif lbound(m)<>1 then ?"LBOUND() ERROR"if ubound(m)<>3 then ?"UBOUND() ERROR"if lbound(m,2)<>-1 then ?"LBOUND() ERROR"if ubound(m,2)<>1 then ?"UBOUND() ERROR"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?