Normal Topic Where to place User Defined Functions? (Read 862 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Where to place User Defined Functions?
May 31st, 2006 at 7:24pm
Print Post Print Post  
I'm ready to add some User Defined Functions to our application but I'm unsure where to put the programming. I want the functions to be available in every form in the application, so it would make sense to place it just once in the Application Property Manager programming slot (on application open) so I can avoid placing it in EVERY Form, as well.

This would be very convenient and would really help to speed up the loading times of my forms.

Am I correct in my thinking?

Thanks,
Steve

Ps. Nice job on the new Forum; it looks great! Smiley
  
Back to top
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Where to place User Defined Functions?
Reply #1 - May 31st, 2006 at 8:31pm
Print Post Print Post  
Hello Steve,

In the current version of Sesame, you will need to declare the functions in Global Code for each form that you want to use the functions on. The on Application open event will not work for what you want to do.

In 2.0 there are include statements, which will allow you to include text files of generic programming functions.

-Ben
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Where to place User Defined Functions?
Reply #2 - May 31st, 2006 at 8:42pm
Print Post Print Post  
Thanks Ben.

The text files option sounds fine for my need and should also be great for making quick changes to our programming without having to shutdown during reconcile.....Should be exciting.

Take care,

steve
  
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: Where to place User Defined Functions?
Reply #3 - May 31st, 2006 at 9:07pm
Print Post Print Post  
Steve,

You are still going to have to shut down in order to reconcile your application. Your Application needs to be closed in order to Reconcile.

The #Include allows you to include into your SBasic program a file of Functions and Subroutines that you have created. Upon compile, when you open the Form for the first time in each mode, that file is included in your code that you wrote in the Program Editor. If you make a change to that file, while people are using the application, each client is going to have to close Sesame and re-open that application before the code changes. So if you change the include file while people are using the application you could end up with half of the people using the new code and the other half using the old code.

Now you do not have to but I recommend the same steps for changing an include file as is mandatory for reconciling an application. I recommend that everyone is out of the application, Server does not need to be shut down but all clients should be closed.

-Ray
  

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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Where to place User Defined Functions?
Reply #4 - May 31st, 2006 at 9:14pm
Print Post Print Post  
Ray,

That makes perfect sense. Thanks again for the helpful info. Looking forward to 2.0 ! Smiley

Take Care,

Steve
  
Back to top
IP Logged