Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
15
Task/Empty-string/Cache-ObjectScript/empty-string.cos
Normal file
15
Task/Empty-string/Cache-ObjectScript/empty-string.cos
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
EMPTYSTR
|
||||
; Demonstrate how to assign an empty string to a variable.
|
||||
set x = ""
|
||||
|
||||
; Demonstrate how to check that a string is empty.
|
||||
; Length 0 is empty; equality/pattern check are 1=T, 0=F
|
||||
write !,"Assigned x to null value. Tests: "
|
||||
write !,"String length: "_$length(x)_", Equals null: "_(x = "")_", Empty pattern: "_(x?."") ; length 0 is empty
|
||||
|
||||
; Demonstrate how to check that a string is not empty. Same as above.
|
||||
set x = " " ;assign to a space - not null
|
||||
write !!,"Assigned x to a single blank space. Tests: "
|
||||
write !,"String length: "_$length(x)_", Equals null: "_(x = "")_", Empty pattern: "_(x?."")
|
||||
|
||||
quit
|
||||
Loading…
Add table
Add a link
Reference in a new issue