Normal Topic What I did today (Read 778 times)
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
What I did today
Mar 12th, 2006 at 3:50am
Print Post Print Post  
Worked at home today (Saturday), so no report on Ray or Erika.

I wrote a new SBasic subroutine: "FormRunProgram(form_name as string, le_name as string, event_number as int)" for Sesame 2.0 that runs the code attached to a different form's LE's. You specify the form name and the LE's name as strings, and the event number as an integer.

0 = LE_ENTER
1 = LE_EXIT
2 = FORM_CHANGE
3 = LE_CHANGE
4 = FORM_ENTER
5 = FORM_EXIT
6 = IMMEDIATE_CHANGE

So to run the on LE enter event on the Descriptions LE on the Gem Types form in the Gems applications from the Gems subform:

Code
Select All
FormRunProgram("Gem Types", "Description" 0)

 

« Last Edit: Mar 12th, 2006 at 5:05am by The Cow »  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: What I did today
Reply #1 - Mar 12th, 2006 at 1:48pm
Print Post Print Post  
Does that mean the code runs on the other form where the code resides, or does the code run on the form you are in where it is called from?

If the former, then I assume the other form must be open?

If the latter, then I assume it only works if the LE names are the same as the other form?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: What I did today
Reply #2 - Mar 12th, 2006 at 1:59pm
Print Post Print Post  
Quote:
Does that mean the code runs on the other form where the code resides, or does the code run on the form you are in where it is called from?


The code runs right where it is on the form and LE it is actually attached to. That form must be open. The form specified cannot be the current form, it must be a different form.

This was written largely to ease inter-form communication and notification. For example, to notify the parent form that a condition on one of its subforms needs its attention / recalculation.


  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: What I did today
Reply #3 - Mar 12th, 2006 at 2:12pm
Print Post Print Post  
Quote:
This was written largely to ease inter-form communication and notification. For example, to notify the parent form that a condition on one of its subforms needs its attention / recalculation.

Oh, very good idea!
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: What I did today
Reply #4 - Mar 12th, 2006 at 2:25pm
Print Post Print Post  
Thanks. Unlike most software companies, Lantica is comprised of companies that do consulting using Sesame/Q&A. It gives us a very direct line on the most pressing needs (as does this Forum) of the folks developing applications using Sesame.

This subroutine came directly out of some consulting work Hammer is doing that involves an application with about twenty subforms and thousands of LEs. In this case the main form needs nearly constant updates based on data from the subs.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged