Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

About to Close Prim (Ruby)

For general discussion related FlowStone

About to Close Prim (Ruby)

Postby DaveyBoy » Sun Apr 22, 2018 2:31 pm

Hi Guys

I am trying to use the 'About to Close' prim in conjunction with Ruby in order to auto save some data to file as the program shuts down:

Image

I've set the delay to 2 seconds just for demo purposes although in reality it would be a fraction of a second.

When I close the 'schematic' window it works as expected with the delay,
when I close the main Flowstone window it shuts down instantly without delay,
when exported to .exe it shuts down instantly without delay . . . although the manual says it works in exported exes & plugins.

Am I missing something simple (highly likely :) ) or does the prim not work as it should?

Alternatively is there another way to do this?

Any help much appreciated

Thanks in advance
Dave
Attachments
Hold Test.fsm
(392 Bytes) Downloaded 799 times
User avatar
DaveyBoy
 
Posts: 131
Joined: Wed May 11, 2016 9:18 pm
Location: Leeds UK

Re: About to Close Prim (Ruby)

Postby tulamide » Sun Apr 22, 2018 11:36 pm

I just made tests with Ruby's kernel method at_exit {}

That's why I have bad news for you. It's not the prim that behaves false, it's Ruby. Unfortunately it seems that DSPRobotics calls Kernel.exit! (note the exclamation mark). Contrary to Kernel.exit, Kernel.exit! ignores all at_exit procedures and directly exits. That's also why I can't offer a Ruby-only solution - because Ruby is the cause!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: About to Close Prim (Ruby)

Postby DaveyBoy » Mon Apr 23, 2018 12:03 am

Thanks for taking the time to look at this Tulamide, very much appreciated.

My small amount of data does actually save without the delay... I was concerned that if I have a large amount of data that the program could close before the data has finished writing.

I'll try and think of another way.

Thanks again T :D
User avatar
DaveyBoy
 
Posts: 131
Joined: Wed May 11, 2016 9:18 pm
Location: Leeds UK

Re: About to Close Prim (Ruby)

Postby tulamide » Mon Apr 23, 2018 12:28 am

DaveyBoy wrote:My small amount of data does actually save without the delay... I was concerned that if I have a large amount of data that the program could close before the data has finished writing.

That is indeed a possibility when using Ruby to write the file. You should be safe though, if using green only.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany


Return to General

Who is online

Users browsing this forum: Google [Bot] and 40 guests

cron