Normal Topic GlobalValue() for use with a Command Button LE (Read 1599 times)
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
GlobalValue() for use with a Command Button LE
Aug 21st, 2018 at 12:48pm
Print Post Print Post  
Hello, I am trying to create a "Backup Button." My original goal was to make Sesame backup automatically on interval. With some research and experimentation I came to find out that this is easier said than done, so I decided to use the method proposed in the Sesame Programming Guide's example. Where you have a button "On Element Entry" that you switch on/off, that when switched on will automatically do an action on interval, every so many seconds or whatever. That should work for now as long as I keep one client running at all times, which is not a problem for the time being.

But my main problem that I'm running into. Is how do I make that command button synchronize across clients. For example: If I switch it "On" on Client 1 how can I make it also show as "On" on Client 2 and so on... Because I don't want to run into the situation where A. Two different Client's are both backing up the application at the same time. Or B. One Client turns on the process then another Client inadvertently turns off the process.

Is there a good workaround for this? I was thinking of using GlobalValue() but I don't quite understand it well and when I tried experimenting with it and WriteLn(), it showed a command prompt window and caused Sesame Designer to crash. Or is there another way?

Any advice is greatly appreciated, thank you.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: GlobalValue() for use with a Command Button LE
Reply #1 - Aug 23rd, 2018 at 4:29pm
Print Post Print Post  
Why not use the built in INI file entry of BACKUP ON INTERVAL?

I doubt it was a crash, was most likely a freeze as Sesame was waiting on whatever shell script you were running to finish, or was stuck in an indefinite loop due to the RunEntryOnInterval() command running over and over again.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: GlobalValue() for use with a Command Button LE
Reply #2 - Aug 24th, 2018 at 1:31pm
Print Post Print Post  
Not sure, I guess I don't know how to use the INI file that much. I'll look into it.
  
Back to top
 
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: GlobalValue() for use with a Command Button LE
Reply #3 - Sep 10th, 2018 at 12:49am
Print Post Print Post  
I turned on the INI file entry of BACKUP ON INTERVAL and it appeared to work for a couple days but now hasn't worked since then.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: GlobalValue() for use with a Command Button LE
Reply #4 - Sep 11th, 2018 at 5:55pm
Print Post Print Post  
That entry will only backup a Sesame application if it is loaded by the Sesame Server at the time the specified interval occurs. If there are no loaded Sesame applications, nothing will be backed up.

If you wish to ensure that the application is loaded by the Sesame Server at that time, set the following entry in your INI file as well.

DATABASE RETENTION: ON

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged