Did you know?

Post your Gambas programming questions here.
User avatar
Got2BeFree
Posts: 91
Joined: Saturday 26th November 2016 2:52am
Location: Lost

Re: Did you know?

Post by Got2BeFree » Friday 19th February 2021 4:21am

progger wrote:
Thursday 18th February 2021 4:11pm
If you create a comment that starts with "TODO:" then that comment shows up in you Notes list. This is a nice way to keep track of your ToDo-list :)
So will "FIXME:" and "NOTE:".
sholzy

I'm wondering around lost in the past, not knowing where the present is.

User avatar
stevedee
Posts: 431
Joined: Monday 20th March 2017 6:06pm

Re: Did you know? ...the Recent Projects screen

Post by stevedee » Tuesday 23rd February 2021 10:36am

I'm probably the last person to discover this, but I sometimes end up with 2 copies of a project in different folders, and then don't know which one to open from the Recent Projects screen.

I don't know why the project path is not shown on-screen, as there is plenty of space for it.

However, if you simply hold the mouse over the project icon, a tool-tip will pop-up and display the path.


Gambas_Recent_Projects.png
Gambas_Recent_Projects.png (228.18 KiB) Viewed 499 times

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

Re: Did you know?

Post by cogier » Tuesday 23rd February 2021 12:11pm

No I did not know that one. Very useful as I also have run into the same issue. Thanks.

User avatar
BruceSteers
Posts: 476
Joined: Thursday 23rd July 2020 5:20pm

Re: Did you know?

Post by BruceSteers » Tuesday 23rd February 2021 2:42pm

I almost submitted a commit with a change to enable this and spotted it already does it when editing the code lol :D

had that issue soooo many times.
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
stevedee
Posts: 431
Joined: Monday 20th March 2017 6:06pm

Re: Did you know? ...Basic declarations in C Libraries

Post by stevedee » Monday 08th March 2021 10:38am

level: Intermediate
category: External C Libraries
subject: Basic declarations in C Libraries


Not everyone would have learnt the C programming language on their path to Gambas greatness.

But when attempting to use a C library in Gambas, you need to understand how routines & functions are declared in C.

Here are a few examples taken from the RaspberryPi pigpio library:-

Code: Select all

int gpioRead(unsigned gpio)
This declaration literally means that "this function will return an integer (int) and requires an unsigned integer (unsigned) argument for a variable named gpio"

So we declare this in Gambas like this:-
Public Extern gpioRead(iPin As Integer) As Integer
...and execute this function in our Gambas code like this:-
intLevel = gpioRead(intPin)

Example 2:-

Code: Select all

int gpioInitialise(void)
In C the keyword "void" means nothing. So this declaration literally means that "this function will return an integer (int) and does not require any arguments (void)".

So we declare this in Gambas like this:-
Public Extern gpioInitialise() As Integer
...and execute this function in Gambas like this:-
intResult = gpioInitialise()
...and then check intResult to see if initialisation was a success or failure.


Example 3:-

Code: Select all

void gpioTerminate(void)
This declaration literally means that "this routine will not return anything (void) and does not require any arguments (void)".

So we declare this in Gambas like this:-
Public Extern gpioTerminate()
...and execute this routine in Gambas like this:-
gpioTerminate()

Post Reply