Did you know?

stevedee
Posts: 85
Joined: Monday 20th March 2017 6:06pm

Re: Did you know?

Post by stevedee » Friday 22nd September 2017 9:25am

In Form view:-
- If you select the width property of a control, the up/down arrows increase/reduce the width.
- If you select the height property of a control, the up/down arrows increase/reduce the height.
- If you select the X property of a control, the up/down arrows move the control right/left.
- If you select the Y property of a control, the up/down arrows move the control down/up.

User avatar
cogier
Site Admin
Posts: 193
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Did you know?

Post by cogier » Friday 22nd September 2017 2:19pm

So it does. Interestng. I knew that using the mouse wheel had that effect.

User avatar
cogier
Site Admin
Posts: 193
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Did you know?

Post by cogier » Friday 22nd September 2017 2:38pm

This does not work with the Cinnamon Desktop as the key stroke is reserved for showing all Virtual Desktops. In the Gambas IDE put the cursor on a line and press [Ctrl]+[Alt]+[Up Arrow]. This will move the whole line up and will jump over other lines. [Ctrl]+[Alt]+[Down Arrow] will move it down. This also works in Writer (for the whole paragraph).

stevedee
Posts: 85
Joined: Monday 20th March 2017 6:06pm

Re: Did you know?

Post by stevedee » Wednesday 16th May 2018 1:46pm

Something I don't do very often is set the "tab" order for controls on a Gambas form. Consequently I struggle to remember how its done.

In Visual Basic it was straightforward, you just gave the "TabIndex" property a suitable integer value. If "TabStop" for a control was set to false, then that control would not respond to Tab.

In Gambas it is a little obscure; go to the Properties view, select Hierarchy and move items in the list via up/down arrows so they tab in the required order. The property "NoTabFocus" determines whether or not a control responds to Tab.

didier18
Posts: 35
Joined: Monday 19th December 2016 10:08pm

Re: Did you know?

Post by didier18 » Thursday 17th May 2018 9:43am

Hello

Very good idea this "Did you know?" section. initiated by cogier. Thank you.

So, did you know? It is possible to compare values, see which routine is called by which routine and optimize its code. To see the execution time of a command, a routine and even a complete program. This tool can be found in the menu /Debug/Activate profiling.
Once this menu is selected, launch the program to be tested as you would normally do... Then close your program. A window will open (as in the example) and you can view the profiling.
Even louder... It is possible to save the profiles, which allows you to compare the evolution with the different versions of your program.
But of course you already knew...

Have a nice day.
Attachments
capture26342.png
capture26342.png (149.91 KiB) Viewed 539 times

User avatar
cogier
Site Admin
Posts: 193
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Did you know?

Post by cogier » Tuesday 26th June 2018 3:02pm

Did you know you can easily move a line, or multiple lines, of code up or down in the editor. Just place the cursor on the line, or highlight the lines, you want to move and press [Alt]+[Up Arrow] (or [Down Arrow]). 8-)

User avatar
jornmo
Site Admin
Posts: 172
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: Did you know?

Post by jornmo » Wednesday 27th June 2018 3:35pm

I doo :lol:

User avatar
cogier
Site Admin
Posts: 193
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Did you know?

Post by cogier » Tuesday 25th September 2018 2:42pm

Here's one I didn't know:-
Dim siRand1, siRand2, siRand3, siRand4 As Short = Rand(0, 9)
This generates random numbers for each variable.

Try this: -
Public Sub Form_Open()
Dim siCount As Short

For siCount = 1 To 10
  Print Generate()
Next

End

Public Sub Generate() As String
Dim siRand1, siRand2, siRand3, siRand4 As Short = Rand(0, 9)

Return Str(siRand1) & Str(siRand2) & Str(siRand3) & Str(siRand4)

End
Result: -
8752
9344
1387
3623
2006
9061
9834
3499
8392
4388

User avatar
jornmo
Site Admin
Posts: 172
Joined: Wednesday 21st September 2016 1:19pm
Location: Norway

Re: Did you know?

Post by jornmo » Thursday 27th September 2018 5:05pm

Remember to use this first:

http://gambaswiki.org/wiki/lang/randomize

User avatar
Quincunxian
Posts: 8
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: Did you know?

Post by Quincunxian » Saturday 29th September 2018 2:27am

While in form design view, if you right click on any control in the bottom right hand corner...
ie a button control, it will open the help about that control.
Cheers - Quin.
I code therefore I am

Post Reply