Main siteMain site  ForumForum  ForumSearch  Private messageEmail contact  RegisterRegister  Log inLog in 
Topic: Count number of sessions
Reply to topic
Author Message
GMartin



Joined: Feb 5, 2010
Posts: 278

PostPosted: Apr 1, 2020 2:10 PM    Post subject: Count number of sessions

Jarek, I am woking with a provider who wants to keep count of the number of sessions used in a design. Is there a way that is possible?
Thanks

George
GMartin



Joined: Feb 5, 2010
Posts: 278

PostPosted: Apr 1, 2020 3:17 PM    Post subject:

Jarek,

After multiple filed attempts I finally got a simple routine working. I was using a scalarvakue but could not get it to save the value. I inserted a slider and had it remember value, hid it, and that worked to increment by one each a button is clicked.
jarek



Joined: Oct 22, 2007
Posts: 789

PostPosted: Apr 1, 2020 6:10 PM    Post subject:

This is a good way.

Another way (I figured before I saw your response) would be to use an external configuration file, read the value and increment it.

Here is a snippet which counts all design loads (and reloads).

http://proatech.com/design/design_load_counter.bpd

You could modify it and trigger when your session is complete.
GMartin



Joined: Feb 5, 2010
Posts: 278

PostPosted: Apr 1, 2020 6:24 PM    Post subject:

Jarek
Thanks
GMartin



Joined: Feb 5, 2010
Posts: 278

PostPosted: Apr 2, 2020 3:06 PM    Post subject:

This is more elegant than my solution. This will be used to monitor session use for home trainers. It will stop the design from loading asger a certain number of sessions. If more sessions are required how could this counter be reset?


Thanks
jarek



Joined: Oct 22, 2007
Posts: 789

PostPosted: Apr 2, 2020 3:15 PM    Post subject:

To reset you can simply delete the xml file, in this case "example.xml" in main folder.

Or write 0 (zero) to the XmlWriter.
Reply to topic