Did you know...
While in form view, you can right-click-drag (just like selecting text to copy) and select the objects?
Did you know?
- Got2BeFree
- Posts: 104
- Joined: Saturday 26th November 2016 2:52am
- Location: Lost
Re: Did you know?
sholzy
I'm wondering around lost in the past, not knowing where the present is.
I'm wondering around lost in the past, not knowing where the present is.
Re: Did you know?
That there is a destructor function for Gambas objects called _free?
From gambas.h, line 1193:
Just found the documentation link:
http://gambaswiki.org/wiki/cat/special
'========================================================'
Public Sub _new()
Randomize
End
'========================================================'
Public Sub _free()
Print "I'm Free"
End
'========================================================'
There are others as well.From gambas.h, line 1193:
Code: Select all
Special methods that can be declared in a class
-----------------------------------------------
_get array reading operator
_put array writing operator
_new constructor
_free destructor
_next next iteration of an enumeration
_call called when the object or the class is used as a function
_unknown called when the name of the property or method is unknown
http://gambaswiki.org/wiki/cat/special
.... and carry a big stick!
Re: Did you know?
DYK that Gambas allows top and bottom testing in the same loop?
Change the 8 to 4, run it again.
Dim i, j As Integer
i = 10
Do While i > 8
j = i * i
Print i, j
Dec i
Loop Until j < 50
Awesome!Change the 8 to 4, run it again.
.... and carry a big stick!
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Did you know?
Did you know that while in the Gambas IDE and editing your code, holding the shift key down and pressing 'Del' will delete the whole line?
Re: Did you know?
DYK that you can comment an entire block of lines by
1) Highlighting them
2) Either press the [Ctrl-k] keys or click on the tiny button with an apostrophe on it above the text editing area.
To uncomment the lines, highlight, then press either [Ctrl-u] or click on the tiny button with an apostrophe and a tiny red x.
That's darn handy.
1) Highlighting them
2) Either press the [Ctrl-k] keys or click on the tiny button with an apostrophe on it above the text editing area.
To uncomment the lines, highlight, then press either [Ctrl-u] or click on the tiny button with an apostrophe and a tiny red x.
That's darn handy.
.... and carry a big stick!
Re: Did you know?
DYK that Gambas also provides for initialization and termination routines at the class level, similar to the _new() and _free() calls for instances.
'=============================================================================
Static Public Sub _init()
' Print "GamePad._init"
' Print Application.Path
' Print Application.Dir
' Print Application.Title
' Print Application.Name
End
'=============================================================================
Static Public Sub _exit()
' Message.Info("GamePad._exit")
End
'=============================================================================
.... and carry a big stick!
- cogier
- Site Admin
- Posts: 1129
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Did you know?
If you want only the data loaded from a file and Split into an array then try this: -
Click here for a larger picture
The dialogue box on the left is the file and on the right is the array.
Check out the IgnoreVoid command here
Dim sData As String[] = Split(File.Load(Application.path &/ "data"), gb.NewLine, "", True)
Click here for a larger picture
The dialogue box on the left is the file and on the right is the array.
Check out the IgnoreVoid command here
- Technopeasant
- Posts: 147
- Joined: Saturday 13th July 2019 6:50pm
- Location: Stony Plain, Alberta, Canada
- Contact:
Re: Did you know?
This should be really helpful for a project of mine. Thanks.
Re: Did you know?
Just to say that the excellent Gambas Buch programming book listed on the Gambas One resource page is also available in English:-
https://gambas-buch.de/dwen/doku.php?id=start
https://gambas-buch.de/dwen/doku.php?id=start
Re: Did you know?
(moved here from General)
Haven't seen this mentioned here, although the Help wiki confirms it. It may initially surprise folks coming from VB that Sub / Function / Procedure 'are synonymous'.
Its not a problem; it just means that when you use Sub or Function your are merely following a naming convention.
That means this works:
Haven't seen this mentioned here, although the Help wiki confirms it. It may initially surprise folks coming from VB that Sub / Function / Procedure 'are synonymous'.
Its not a problem; it just means that when you use Sub or Function your are merely following a naming convention.
That means this works:
' Gambas module file
Public Sub Main()
Print Procedure1("Hello world")
Print Procedure2("Hello world")
Procedure3("Hello world")
Print Procedure4("Hello world")
Procedure5("Hello world")
End
Private Function Procedure1(val As String) As String
Return String.Upper(val)
End
Private Sub Procedure2(val As String) As String
Return String.Upper(val)
End
Private Function Procedure3(val As String)
Print String.Upper(val)
End
Private Procedure Procedure4(val As String) As String
Return String.Upper(val)
End
Private Procedure Procedure5(val As String)
Print String.Upper(val)
End