RosettaCodeData/Task/Naming-conventions/M2000-Interpreter/naming-conventions.m2000
2023-07-01 13:44:08 -04:00

34 lines
845 B
Text

Class Alfa$ {
Private:
myValue$
Public:
Set {
Read .myValue$
}
Value {
=.myValue$
}
Module Doit {
Function TwoChars$(A$) {
=Left$(Left$(a$,1)+Right$(a$,1)+"??",2)
}
Print TwoChars$(.myValue$)
Dim A$(3)
A$(0)="zero","one","two"
Print A$(1)
k$=Lambda$ A$() (x) -> {
if x>0 and x<3 then {=A$(x)} else =A$(0)
}
Print k$(2)
Dim A$()
Print Len(A$())=0
Print k$(2)="two"
}
}
A$=Alfa$()
Module CheckIt(&B$) {
Input "name:", B$
B.Doit
}
Checkit &A$
Print A$