Τετάρτη 6 Νοεμβρίου 2024

Revision 43, Version 12

1. A Bug removed. Passing Enum value with minus sing as parameter to a numeric variable now has the proper sign.

enum aa {one=1, two=2}
def foo(x as long)=x
print foo(-one)=-1 ' previous was 1

2. Using READ and LET for arrays with square brackets

Single a[4]
// the Let evaluate first the expression right from assign symbol =
// then evaluate the index(es) of the array
Let a[4]=1.343 ' not supported before
// without Let evaluation of index(es) of array and then expression after =
a[5]=1.343 ' had no problem
Print a[4], a[5]
data 1.4545
k=random(0, 4)
// Read not supported before for array items of this type of array
read a[k]
print k, a[k]
// still the by reference pass of an array item of this type not supported

3. New programs in INFO file

function multidim_integer(v) {
select case stack.size
case 0
error "Missing Parameters"
case 1
integer a[number]=v:=a
case 2
integer a[number][number]=v:=a
else case ' after each case One line or One Block
{
read k: bb=[]: object b[0]
for j=0 to k: b[j]=lambda(v, !stack(bb)): next
=b
}
end select
}
k=multidim_integer(500, 2, 4, 2, 3)
Print "K has ";3*5*3*4; " items with starting value:";500 ' 180 items
k[0][1][2][0]=1,2,3,4
Print k[0][0][0][0]-99=k[0][1][2][0]+400 ' true
flush
data 100,200,300,400
for i=0 to 3
read k[0][1][1][i]
k[0][1][1][i]++
k[2][1][1][i]+=1000
Let k[1][1][2][i] = k[0][1][1][i] - 50
print k[0][1][1][i], k[0][1][2][i], k[1][1][2][i], k[2][1][1][i]
next

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου

You can feel free to write any suggestion, or idea on the subject.