Normal Topic FormRunProgram ( ) Question (Read 361 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
FormRunProgram ( ) Question
Mar 23rd, 2012 at 9:23pm
Print Post Print Post  
Code
Select All
If @AskUser ("Do you want to Include Shot Record?", "", "" ) then

	{

		vRSHIM = @XResultSetSearch(@FN, "Index", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!RecNumber="+ RecNumber)
			if(vRSHIM > -1)
				{

					vSuccess = @Shell ( "RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n " +  @Chr (34) + vPrinter1 + @chr (34) )
					//AlternateDefaultPrinter (vPrinter1)
					WarningLevel(0)
					XResultSetOpenForm(vRSHandle, "ShotRecord")
					WarningLevel(1)
					//vResult = @PrintAform (Print_Singular, Print_No_Background, Print_Orientation_Portrait, Print_No_Dialog, Print_Paper_Letter, 0, 0, 0, 0, 1, 1)
					//RestoreDefaultPrinter ( )


						FormRunProgram("ShotRecord", "TB3", PROGRAM_EVENT_LE_Enter)





					XResultSetClose(vRSHIM)
				}
				FormExit ("ShotRecord")




	}
 



If the code is in the command button then FormRunProgram ( ) does not seem to run. Is this a normal behavior.  It works well if TB3 is text element. Just wondering.

  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: FormRunProgram ( ) Question
Reply #1 - Mar 23rd, 2012 at 9:32pm
Print Post Print Post  
Only the code on ElementEnter event on commandbutton does not work. But if I put the code in the commandbutton on  element change event, that never happens.. but it will work with FormRunProgram (). Very interesting!
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: FormRunProgram ( ) Question
Reply #2 - Mar 23rd, 2012 at 9:35pm
Print Post Print Post  
Bharat_Naik wrote on Mar 23rd, 2012 at 9:32pm:
Only the code on ElementEnter event on commandbutton does not work. But if I put the code in the commandbutton on  element change event, that never happens.. but it will work with FormRunProgram (). Very interesting!


Buttons have some differences in when they run their on enter code, so as to prevent the code from running when you simply set focus on the button. That may be what you are seeing here.

If you wish the code to be on a button, use a subroutine and call it from the button and from another element. Use the other element to launch the code above.
  

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