-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.xojo_code
74 lines (56 loc) · 2.03 KB
/
App.xojo_code
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#tag Class
Protected Class App
Inherits ConsoleApplication
#tag Event
Function Run(args() as String) As Integer
TestAggregateFunctions
TestTextFunctions
End Function
#tag EndEvent
#tag Method, Flags = &h1
Protected Sub TestAggregateFunctions()
// Aggregate Functions
Print "Aggregate Functions:"
Print "FM.Average: " + Str(FM.Average(5, 10, 20))
Print "FM.Min: " + Str(FM.Min(5, 10, 20))
Print "FM.Min: " + Str(FM.Min("hello", "first", "last"))
Dim d1 As New Xojo.Core.Date(2010, 09, 15, Xojo.Core.TimeZone.Current)
Dim d2 As New Xojo.Core.Date(2008, 04, 1, Xojo.Core.TimeZone.Current)
Print "FM.Min: " + FM.Min(d1, d2, Xojo.Core.Date.Now).ToText
Print ""
Print "FM.Max: " + Str(FM.Max(5, 10, 20))
Print "FM.Max: " + Str(FM.Max("hello", "first", "last"))
Print "FM.Max: " + FM.Max(d1, d2, Xojo.Core.Date.Now).ToText
Print ""
Print "FM.Sum: " + Str(FM.Sum(5, 10, 20))
End Sub
#tag EndMethod
#tag Method, Flags = &h1
Protected Sub TestDateFunctions()
// Date Functions
End Sub
#tag EndMethod
#tag Method, Flags = &h1
Protected Sub TestGetFunctions()
End Sub
#tag EndMethod
#tag Method, Flags = &h1
Protected Sub TestTextFunctions()
Print "Length: " + FM.Length("Hello, world.").ToText
Print "Left: " + FM.Left("Hello, world.", 5)
Print "LeftWords: " + FM.LeftWords("First Middle Last Suffix", 3)
Print "Lower: " + FM.Lower("Hello, world.")
Print "Middle: " + FM.Middle("Hello, world.", 1, 4)
Print "MiddleWords: " + FM.MiddleWords("First Middle Last Suffix", 3, 2)
Print "Proper: " + FM.Proper("john doe")
Print "Right: " + FM.Right("Hello, world.", 5)
Print "RightWords: " + FM.RightWords("First Middle Last Suffix", 2)
Print "Substitute: " + FM.Substitute("Hello, world.", "Hello", "Goodbye")
Print "Trim: " + FM.Trim(" This is a test. ")
Print "Upper: " + FM.Upper("john doe")
End Sub
#tag EndMethod
#tag ViewBehavior
#tag EndViewBehavior
End Class
#tag EndClass