Re: Calling Forms4 User Exits from a Library?

From: Dennis Moore <dbmoore_at_us.oracle.com>
Date: 25 Apr 94 17:13:40 GMT
Message-ID: <1994Apr25.171340.226_at_oracle.us.oracle.com>


In article <CotLHJ.9xo_at_apollo.hp.com> daveo_at_wal.hp.com (David Owens) writes:
>Dennis Moore (dbmoore_at_us.oracle.com) wrote:
>: I believe that the way most people handle this problem (see below) is that
>: they always pass into libraries all the values it will need to do its
>: processing. In fact, this is the only "right" way to use libraries, since
> ... stuff about Name_In functions deleted.
>
>
>You obviously misunderstood the reason why I'm asking the question. I
>don't wan't to know how to pass variables into a library. I know that.
>I want to know how to pass these same variables into a user exit and
>back out. If you see the original post, you'll see that there is a
>problem with addressing these library variables in a user exit.
>
>So, anyone else want to take a crack at this one?
>
>David Owens ------- ___o Hewlett-Packard

Oops. Sorry, I thought you asked how to reference Forms variables in libraries. Hope you don't mind if I take another crack at it (and in my behalf, let me just say that I am NOT in Tech Support, so don't expect this kind of silliness when you call them!). To get Forms variables in a user exit you must either:

  • pass them in as arguments i.e. USER_EXIT ('CALCULATE_VALUES PARAM1 PARAM2');
  • use Pro*3GL's EXEC TOOLS GET command

Here is the syntax and an example of EXEC TOOLS GET from the Forms Reference Manual. If you have trouble GETting library variables, try copying them into GLOBALs before calling your user exit, and then GETting or SETting the global. I've never tried this with library variables, so I'm not sure that you can GET or SET them directly.


EXEC TOOLS GET Statement

An EXEC TOOLS GET statement passes a value from Oracle Forms to an Oracle Precompiler user exit. Specifically, it places the value of an Oracle Forms item or variable into a host language variable. Once Oracle Forms passes a value to a user exit, the user exit can use that value for calculation, manipulation, or updating.

Syntax

	EXEC TOOLS GET form_variable_1[, form_variable_2, ...]
			INTO :host_variable_1[, :host_variable_2, ...];

	where:

		form_variable_n	Specifies the name of the form item or
		Oracle Forms variable from which you are reading a value.

		host_variable_n	Specifies the name of the host language
		variable into which you are reading a value.

	Notes

		The form_variable can be a reference to any of the following
		items:

		a fully-qualified item (block.item)
		a form parameter
		an Oracle Forms system variable
		an Oracle Forms global variable
		a host language variable (prefixed with a colon) whose value
			is any of the above choices

Refer to the Programmer's Guide to the Oracle Precompilers for any restrictions on host language variables.

                                                                                Restrictions

It is not possible to get or set values directly into a record group from a user exit.

Example

	/*
	** Example:  Read an item name from a block (empblock.empname)
	*/
	EXEC SQL BEGIN DECLARE SECTION;
		char fld_buff[255];  /*buffer for field value */
		VARCHAR fld_name[255]; /* Forms field name */
	EXEC SQL END DECLARE SECTION;

	strcpy(fld_name.arr,"EMBLOCK.EMPNAME");
	fld_name.len=strlen("EMBLOCK.EMPNAME");
	EXEC TOOLS GET :fld_name
		INTO :fld_buff;


Hope this helps ... Received on Mon Apr 25 1994 - 19:13:40 CEST

Original text of this message