Normal Topic What should I use instead of "STOP"? (Read 719 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
What should I use instead of "STOP"?
Oct 22nd, 2010 at 1:52pm
Print Post Print Post  
I have the following programming on a "Print Workorder" button:
Code
Select All
IF (Salesman = "RS" or Carrier = "Russell-Stimpson")
THEN
	IF @AskUser("You are printing a Russell-Stimpson workorder to the MIARA workorder printer.",
		"Should Sesame change the Salesman code to JM and the Carrier and Company info to Miara Transportation?",
		"NOTE: the current information will be maintained if you select NO or ESCAPE.")
	THEN
	{
	Salesman = "JM"
	Carrier = "Miara Transportation"

	IF Pickup_Company = "Russell-Stimpson"
	THEN Pickup_Company = "Miara Transportation"

	IF Delivery_Company = "Russell-Stimpson"
	THEN Delivery_Company = "Miara Transportation"
	} 


If the user answers YES then the data is changed and printing continues with the printing programming (a huge chunk of programming) that follows this test.  However, if the user answers NO or hits ESCAPE, the data is not changed...but the printing then occurs anyway using the programming that follows the test.  What I want is for the printing to not occur at all if the answer is NO.  How can I get this action to stop without using STOP?  I tried using ThrowFocus() but that didn't work.

Thanks for your help.
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: What should I use instead of "STOP"?
Reply #1 - Oct 22nd, 2010 at 2:02pm
Print Post Print Post  
Hello Infinity,

Try

Code
Select All
Var vQuitFlag as Int

vQuitFlag = 0

IF (Salesman = "RS" or Carrier = "Russell-Stimpson")
THEN
	IF @AskUser("You are printing a Russell-Stimpson workorder to the MIARA workorder printer.",
		"Should Sesame change the Salesman code to JM and the Carrier and Company info to Miara Transportation?",
		"NOTE: the current information will be maintained if you select NO or ESCAPE.")
	THEN
	{
	Salesman = "JM"
	Carrier = "Miara Transportation"

	IF Pickup_Company = "Russell-Stimpson"
	THEN Pickup_Company = "Miara Transportation"

	IF Delivery_Company = "Russell-Stimpson"
	THEN Delivery_Company = "Miara Transportation"
	}
	ELSE
	{
		vQuitFlag = 1
	}
} 



Then around your printing code

Code
Select All
If vQuitFlag = 0 Then
{
	//Printing Code here
} 



-Ray
« Last Edit: Oct 22nd, 2010 at 4:49pm by Ray the Reaper »  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: What should I use instead of "STOP"?
Reply #2 - Oct 22nd, 2010 at 2:23pm
Print Post Print Post  
Thanks Ray!  Most appreciated.
  

**
Captain Infinity
Back to top
IP Logged
 
tcgeo
Full Member
***
Offline



Posts: 278
Location: Traverse City, Michigan
Joined: May 13th, 2008
Re: What should I use instead of "STOP"?
Reply #3 - Nov 23rd, 2010 at 1:27pm
Print Post Print Post  
Thanks for this Ray!

I've been struggling with "Stop" also, not any longer!

Have a happy Turkey Day!
  
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: What should I use instead of "STOP"?
Reply #4 - Nov 23rd, 2010 at 2:33pm
Print Post Print Post  
Hope you have a Happy Thanksgiving as well Brandon!

-Ray
  

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