-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput-color.sc
40 lines (38 loc) · 894 Bytes
/
output-color.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
TYPE Outer
DECLARE field1: INTEGER
DECLARE field2: BOOLEAN
DECLARE field3: STRING
DECLARE inner: Inner
DECLARE field4: ARRAY[1:4] OF INTEGER
ENDTYPE
TYPE Inner
DECLARE field1: DATE
DECLARE field2: ARRAY[1:4] OF REAL
ENDTYPE
CLASS Foo
PUBLIC prop1: CHAR
PUBLIC outer: Outer
PUBLIC prop2: STRING
PUBLIC inner: Inner
PUBLIC prop3: CHAR
PUBLIC PROCEDURE NEW()
prop1 <- 'a'
prop2 <- "Property 2"
prop3 <- 'z'
outer.field1 <- 54
outer.field2 <- FALSE
outer.field3 <- "Inner struct"
outer.field4[1] <- 1
outer.field4[2] <- 2
outer.field4[3] <- 3
outer.field4[4] <- 4
inner.field1 <- SETDATE(31, 5, 2025)
outer.inner.field1 <- SETDATE(15, 1, 2025)
inner.field2[2] <- 4.5
outer.inner.field2[2] <- 45
ENDPROCEDURE
ENDCLASS
DECLARE foo: Foo
foo <- NEW Foo()
OUTPUT "Formatting demo: ", foo
OUTPUT "Formatting complete"