Page 1 of 2

Advise on a idea

Posted: Wednesday 21st July 2021 10:15pm
by AndyGable
Hi Everyone,

I was hoping I could get some advise on a idea that I am thinking about

This is what I have at the moment a small
Application written in Gambas that connects to a central MySQL server and pulls down all data from that server to a local MySQL server (this may change if I can find a low memory database that works with Gambas)

The sync app starts full screen but once it has done the first sync (get all data etc) from the server is there a way to switch it to a screenless app in the background?

I know if I start the app like

./home/algpos/dbsyc/dbsync.gambas && the app will run in the background but I need it to be in the only app that has focus until it has completed its work.

Is it possible to switch apps between main and background work?

Re: Advise on a idea

Posted: Wednesday 21st July 2021 11:40pm
by BruceSteers
it may not retain focus but you can set Form.TopOnly = True or False and Form.Stacking = Window.Above or Window.Normal
that will keep your window above all the others and you can unset the flags when it's done

Re: Advise on a idea

Posted: Wednesday 21st July 2021 11:41pm
by BruceSteers
if you want your app to talk to other gambas apps of yours then look into DBus

Re: Advise on a idea

Posted: Thursday 22nd July 2021 1:06am
by AndyGable
I'm using pipe to talk between the apps

Re: Advise on a idea

Posted: Thursday 22nd July 2021 7:12am
by BruceSteers
AndyGable wrote: Thursday 22nd July 2021 1:06am I'm using pipe to talk between the apps
cool then your main app could disable the other apps while it's working then release them when it's done it's business

Re: Advise on a idea

Posted: Thursday 22nd July 2021 9:34am
by PJBlack
i honestly don't understand the intention behind your question ...

is it about computation time? then have a look at the command nice (i have seen functional somewhere in gambas too)

and an application that compares the data ... uh yes ... if you have two mysql servers running anyway (i hope you mean mariadb) have a look at the terms replication, and/or cluster and let the one who can do it best do the work ...
if you need something small on the client side you could also use sqlite and mariadb/mysql on the server ... also with this the replication works


Translated with www.DeepL.com/Translator

Re: Advise on a idea

Posted: Thursday 22nd July 2021 12:07pm
by BruceSteers
I think i may have misread the question, you kinda lost me a bit at SQL..

How about something like...
FMain.FullScreen = True

' do your routines..

' when finished

FMain.FullScreen = False


Re: Advise on a idea

Posted: Thursday 22nd July 2021 12:23pm
by AndyGable
BruceSteers wrote: Thursday 22nd July 2021 12:07pm I think i may have misread the question, you kinda lost me a bit at SQL..

How about something like...
FMain.FullScreen = True

' do your routines..

' when finished

FMain.FullScreen = False

That does not put the application into the background that only makes the app screenless.

Re: Advise on a idea

Posted: Thursday 22nd July 2021 12:26pm
by AndyGable
PJBlack wrote: Thursday 22nd July 2021 9:34am i honestly don't understand the intention behind your question ...

is it about computation time? then have a look at the command nice (i have seen functional somewhere in gambas too)

and an application that compares the data ... uh yes ... if you have two mysql servers running anyway (i hope you mean mariadb) have a look at the terms replication, and/or cluster and let the one who can do it best do the work ...
if you need something small on the client side you could also use sqlite and mariadb/mysql on the server ... also with this the replication works


Translated with www.DeepL.com/Translator
@PJBlack
Yes Replication would be a way to do this but it would replicate EVERY things from the Master Database to the Local PoS Database and I do not need every table and every field on the local PoS Database.

I have created the sync app so I can control what information is sent to the master database (mysql) and what is deleted from the local Database.

Does anyone have any examples of how to use sqlite with Gambas?

Re: Advise on a idea

Posted: Thursday 22nd July 2021 6:04pm
by PJBlack
AndyGable wrote: Thursday 22nd July 2021 12:26pmDoes anyone have any examples of how to use sqlite with Gambas?
https://gambaswiki.org/wiki/howto/databasesqlite
https://gambaswiki.org/wiki/comp/gb.db/connection
https://www.sqlite.org

the difference between sqlite and real dbms is a) the lack of user management, b) sqlite is local and file based and c) the usual small things ...

if you have a connection open sqlite will be accessed via sql just like other databases ...

AndyGable wrote: Thursday 22nd July 2021 12:23pmThat does not put the application into the background that only makes the app screenless.
https://gambaswiki.org/wiki/comp/gb/app ... n/priority
https://gambaswiki.org/wiki/comp/gb/application/daemon