Normal Topic FormThrowFocus (Read 1177 times)
Andy
Member
*
Offline



Posts: 39
Location: Massachusetts
Joined: Aug 26th, 2014
FormThrowFocus
Feb 5th, 2015 at 10:55pm
Print Post Print Post  
I attempted to use FormThrowFocus with no luck.  I entered the command in a line item database and it did not work as I expected. Anyone have any secrets?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormThrowFocus
Reply #1 - Feb 6th, 2015 at 2:05pm
Print Post Print Post  
It would help if you post your code so we can see what you are trying to do. It would also help if you describe what did happen.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Andy
Member
*
Offline



Posts: 39
Location: Massachusetts
Joined: Aug 26th, 2014
Re: FormThrowFocus
Reply #2 - Feb 6th, 2015 at 3:44pm
Print Post Print Post  
Thank you for the Response. After trying to debug I determined that the problem is due to the "on entry" aspect.  Seems that I end up in a loop and attempted to "bail out" using either GoTo or FormThrowFocus command that was not working.  Is there any command that will bail me out of an element in a subform?
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FormThrowFocus
Reply #3 - Feb 9th, 2015 at 2:04am
Print Post Print Post  
The STOP command will stop all code from running, but you are better off if you use a variable as a flag to keep track of whether a section of code should run, or not. Or just use some other conditionals to determine if a particular section of code should execute.
  


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


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormThrowFocus
Reply #4 - Feb 9th, 2015 at 2:32pm
Print Post Print Post  
In Q&A, you used GoTo (or GoSub and Return) to jump to another field which had On Entry programming. This behavior was a kludge meant to imitate the effects of calling a subroutine. In Sesame, you actually have the ability to call subroutines, so tricks like that are not necessary.

GOSUB, RETURN, and STOP are deprecated in Sesame and may not work as they did in Q&A. Instead, you do something like this:

Code
Select All
var vLoop as Int
var vQuit as Int

SUBROUTINE hdsDoStuff(aNum as Int)

	WriteLn("Here we are! - " + @Str(aNum))

END SUBROUTINE

	vQuit = 0
	vLoop = 1
	While((vLoop < 10) And (vQuit = 0))
	{
		If vLoop = 6
		{
			vQuit = 1
		}
		Else
		{
			hdsDoStuff(vLoop)
		}
		vLoop = vLoop + 1
	}
 



This produces the following output in the WriteLn window:
Here we are! - 1
Here we are! - 2
Here we are! - 3
Here we are! - 4
Here we are! - 5

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged