Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Empty-string/M2000-Interpreter/empty-string-1.m2000
Normal file
2
Task/Empty-string/M2000-Interpreter/empty-string-1.m2000
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
A$=""
|
||||
Print A$<>"", A$="", Len(A$)=0
|
||||
86
Task/Empty-string/M2000-Interpreter/empty-string-2.m2000
Normal file
86
Task/Empty-string/M2000-Interpreter/empty-string-2.m2000
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
Module Checkit {
|
||||
\\
|
||||
\\ Part 1: Make global variable, alter it, make a shadow local or global one, use temporary variable
|
||||
\\
|
||||
Global a$="ok"
|
||||
Module Global What {
|
||||
Print a$
|
||||
}
|
||||
Module Checkit {
|
||||
Print a$="ok"
|
||||
a$<=""
|
||||
Print a$=""
|
||||
a$<="ok2"
|
||||
a$=""
|
||||
Print a$="", a$<>""
|
||||
Global a$="ok again"
|
||||
Module Inner {
|
||||
Print a$="ok again"
|
||||
}
|
||||
Inner
|
||||
What \\ now What use new global a$
|
||||
\\ display list of public variables
|
||||
List
|
||||
\\ we can define locals using Def, but raise error if local exist
|
||||
Try {
|
||||
Def a$="error"
|
||||
}
|
||||
Def b$
|
||||
Print b$=""
|
||||
For This {
|
||||
\\ block for temporary definitions
|
||||
For i=1 to 10 {
|
||||
Local a$=str$(i)
|
||||
}
|
||||
\\ we get 10 more a$
|
||||
List
|
||||
Print a$=" 10"
|
||||
}
|
||||
Print a$=""
|
||||
List
|
||||
\\ using current stack
|
||||
}
|
||||
\\ we call always a local module, or a global, but not this module,
|
||||
\\ no recursion for standard call for modules.
|
||||
\\ we have to use Call Checkit to call this module recursive
|
||||
Checkit
|
||||
What \\ now what use old global a$
|
||||
Print a$<>"" ' true
|
||||
List
|
||||
|
||||
\\
|
||||
\\ Part 2: Pass an empty string to a variable through stack of values
|
||||
\\
|
||||
Module Checkit2 {
|
||||
\\ read make a local by default
|
||||
Read a$
|
||||
Print a$="" ' true
|
||||
For This {
|
||||
Push "Hello"
|
||||
Read New a$
|
||||
Print a$="Hello"
|
||||
List
|
||||
}
|
||||
Print a$=""
|
||||
}
|
||||
Checkit2 ""
|
||||
Print a$<>"" ' true
|
||||
Module Checkit3 {
|
||||
\\ using Set we change to global space, for the end of line
|
||||
Set Read a$
|
||||
Print a$="" ' true
|
||||
list
|
||||
}
|
||||
Checkit3 ""
|
||||
Print a$<>"" ' true
|
||||
Module Checkit4 {
|
||||
\\ this make a local if no global exist
|
||||
\\ so if global exist, alter the global one
|
||||
Let a$=Letter$
|
||||
Print a$="" ' true
|
||||
list
|
||||
}
|
||||
Checkit4 ""
|
||||
Print a$="" ' true
|
||||
}
|
||||
Checkit
|
||||
Loading…
Add table
Add a link
Reference in a new issue