Examples in Gambas (#5) by @vdelacruzjardon

This commit is contained in:
vdelacruzjardon
2016-09-16 13:41:52 -05:00
committed by Aditya Bhargava
parent e2a4153e80
commit 0aec97dbf2
41 changed files with 355 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.5.4
Title=01_countdown
Startup=countdown
Version=0.0.1
TabSize=2
Packager=1

View File

@@ -0,0 +1,15 @@
' Gambas module file
Function countdown(i As Integer) As Integer
Print i
If i <= 0 Then
Return
Else
countdown(i - 1)
Endif
End
Public Sub Main()
countdown(5)
End

View File

@@ -0,0 +1,7 @@
countdown
01_countdown
0
0
0.0.1

Binary file not shown.

View File

@@ -0,0 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.5.4
Title=02_greet
Startup=greet
Version=0.0.1
TabSize=2
Packager=1

View File

@@ -0,0 +1,17 @@
' Gambas module file
Function greet2(name As String)
Print "how are you, "; name; "?"
End
Function bye()
Print "ok bye!"
End
Function greet(name As String)
Print "hello, "; name; "!"
greet2(name)
Print "getting ready to say bye..."
bye()
End
Public Sub Main()
greet("adit")
End

View File

@@ -0,0 +1,7 @@
greet
02_greet
0
0
0.0.1

Binary file not shown.

View File

@@ -0,0 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.5.4
Title=03_factorial
Startup=factorial
Version=0.0.1
TabSize=2
Packager=1

View File

@@ -0,0 +1,14 @@
' Gambas module file
Function fact(x As Float) As Float
If x = 1 Then
Return 1
Else
Return x * fact(x - 1)
Endif
End
Public Sub Main()
Print fact(5)
End

View File

@@ -0,0 +1,7 @@
factorial
03_factorial
0
0
0.0.1