Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -43,3 +43,55 @@ Module CheckIt {
CP=>PrintAll
}
CheckIt
' like c++
Module CheckIt {
Class Camera {
Property cameratype$ {
value,
set {
read value$
if value$="" then Error "Null value not accepted"
}
}
Class:
module Camera (.cameratype$){
}
}
\\ INHERITANCE AT CODE LEVEL
Class MobilePhone {
Property model$ {
value,
set {
read value$
if value$="" then Error "Null value not accepted"
}
}
Class:
module MobilePhone (.model$) {
}
}
Class CameraPhone {
{
' these are local variables, not object's variables
Read model$, cameratype$
}
' we use these variable$ here:
Camera Gadget(model$)
MobilePhone Device(cameratype$)
}
' you can't pass null
CP1=CameraPhone("X-15", "OBSCURE")
Print CP1 is type CameraPhone = true
Print CP1 is type Camera = false
Print CP1 is type MobilePhone = false
Print CP1.Device.model$;" "; CP1.Gadget.cameratype$
Try ok {
' we get error
CP2=CameraPhone("X-15", "")
}
If Error Then Print Error$
}
CheckIt