Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,13 @@
Module Check {
Module MyBeta (a) {
Print "MyBeta", a/2
}
Module TestMe {
Module Beta (x) {
Print "TestMeBeta", x
}
Beta 100
}
TestMe ; Beta as MyBeta
}
Check

View file

@ -0,0 +1,45 @@
Module Check {,
\\ make an event object
\\ with a prototype signature
\\ first parameter is numeric/object by value, and second is by reference
Event Alfa {
Read x, &z
}
\\ make a function with same signature
Function ServiceAlfa {
read a, &b
b+=a
}
\\ add function to event
Event Alfa new &ServiceAlfa()
\\ call event in this module
var=30
Call Event Alfa, 10, &var
Print var=40
\\ make a local module, and pass event by value
Module checkinside (ev) {
\\ ev is a copy of Alfa
m=10
call event ev, 4, &m
Print m=14
\\ clear functions from ev
Event ev Clear
\\ we can call it again, but nothing happen
call event ev, 4, &m
Print m=14
}
checkinside Alfa
\\ so now we call Alfa
Call Event Alfa, 10, &var
Print var=50
Event Alfa Hold
\\ calling do nothing, because of Hold state
Call Event Alfa, 10, &var
Event Alfa Release
Call Event Alfa, 10, &var
Print var=60
}
Check

View file

@ -0,0 +1,51 @@
Module Check {,
\\ make an event object
\\ with a prototype signature
\\ first parameter is numeric/object by value, and second is by reference
Event Alfa {
Read x, &z
}
\\ make a function with same signature
\\ but here prepared to used with current module visibility
m=0
Function ServiceAlfa {
\ this code "see" m variable
\\ we have to use new, to make new a, b for sure
read new a, &b
b+=a
m++
}
\\ add function to event, making reference as local to module
Event Alfa new Lazy$(&ServiceAlfa())
\\ call event in this module
var=30
Call Event Alfa, 10, &var
Print var=40
\\ make a local module, and pass event by value
Module checkinside (ev) {
\\ ev is a copy of Alfa
m=10
call event ev, 4, &m
Print m=14
\\ clear functions from ev
Event ev Clear
\\ we can call it again, but nothing happen
call event ev, 4, &m
Print m=14
}
checkinside Alfa
\\ so now we call Alfa
Call Event Alfa, 10, &var
Print var=50
Event Alfa Hold
\\ calling do nothing, because of Hold state
Call Event Alfa, 10, &var
Event Alfa Release
Call Event Alfa, 10, &var
Print var=60
Print m=4 ' 4 times called ServiceAlfa
}
Check

View file

@ -0,0 +1,50 @@
Module Check {,
\\ make an event object
\\ with a prototype signature
\\ first parameter is numeric/object by value, and second is by reference
Event Alfa {
Read x, &z
}
\\ make a group function with same signature
Group IamStatic {
m=0
Function ServiceAlfa(a, &b) {
b+=a
.m++
}
}
\\ add function to event, making reference as local to module
Event Alfa new &IamStatic.ServiceAlfa()
\\ call event in this module
var=30
Call Event Alfa, 10, &var
Print var=40
\\ make a local module, and pass event by value
Module checkinside (ev) {
\\ ev is a copy of Alfa
m=10
call event ev, 4, &m
Print m=14
\\ clear functions from ev
Event ev Clear
\\ we can call it again, but nothing happen
call event ev, 4, &m
Print m=14
}
checkinside Alfa
\\ so now we call Alfa
Call Event Alfa, 10, &var
Print var=50
Event Alfa Hold
\\ calling do nothing, because of Hold state
Call Event Alfa, 10, &var
Event Alfa Release
Call Event Alfa, 10, &var
Print var=60
Print IamStatic.m=4 ' 4 times called IamStatic.ServiceAlfa
}
Check