Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaration of Local External Function Limit??????

Status
Not open for further replies.

bubbly

Programmer
Mar 28, 2003
74
0
0
AE
i am unable to add new local external functions. is there a limit for adding the number of functions. if tried to add new ones it terminates the last ones. how do we solve it out.
 
No limit that I am aware of, unless you are trying to declare the entire API.


Paul Mele
DFAS-CL/TSTB
 
I have declare around 200-250 local external functions. When trying to save the next few, it either terminates the ones before or does not paste the next ones
 
Why would you want that many in a single object? Break it down into related elements. For example, create on for FileOps API, another for DeskTop, another for String and so on. Then create a main nvo which creates an instance of them.

We created a single system funtion base called nvo_sysfunc_services and then created individual nvo's for specific items. This one is for base windows api's

--------------------------------------------------
Export for one of the inherited services
--------------------------------------------------
Code:
forward
global type nvo_sysfunc_platform from nvo_sysfunc_services
end type
end forward

global type nvo_sysfunc_platform from nvo_sysfunc_services
end type
global nvo_sysfunc_platform nvo_sysfunc_platform

type prototypes
// Windows 32 Bit calls
Function boolean	CreateDirectoryA (ref string pathname, int sa) Library "kernel32.dll"
Function ulong 	CreateMutex(ULong lpsa, Boolean fInitialOwner, String lpszMutexName) Library 'kernel32.dll' Alias for CreateMutexA
Function ulong	   WNetGetConnectionA (ref string drv, ref string unc, ref ulong buf ) Library "Mpr.dll"
....etc....
end prototypes

type variables
// ShowWindow() Commands
CONSTANT LONG SW_HIDE = 0;
CONSTANT LONG SW_SHOWNORMAL = 1;
...etc...
end variables

forward prototypes
public function boolean createdirectory (string as_path)
public function boolean setcurrentdirectory (string as_path)
...etc...
end prototypes
-------------------------------------------------

Then the main nvo ties all of these together into one

--------------------------------------------------
Export for the main nvo
--------------------------------------------------
Code:
forward
global type nvo_sysfunc from nonvisualobject
end type
end forward

global type nvo_sysfunc from nonvisualobject
end type
global nvo_sysfunc nvo_sysfunc

type variables
nvo_sysfunc_datetime   invo_datetime
nvo_sysfunc_file       invo_file
nvo_sysfunc_inifile    invo_inifile
nvo_sysfunc_platform   invo_platform
nvo_sysfunc_window     invo_window
...etc...
end variables

forward prototypes
public function boolean uf_movefile (string as_from, string as_to)
public function integer uf_parsefilename (string rawfile, ref string drive, ref string path, ref string basename, ref string extension)
public function string uf_findfile (string as_filename)
...etc...
end prototypes


public function boolean uf_movefile (string as_from, string as_to);Return invo_file.MoveFile(as_from, as_to)

end function

public function integer uf_parsefilename (string rawfile, ref string drive, ref string path, ref string basename, ref string extension);Return invo_file.ParseFileName(rawfile, drive, path, basename, extension)

end function

public function string uf_findfile (string as_filename);Return invo_file.FindFile(as_filename)

end function
...etc...
--------------------------------------------------

Note, this main nvo merely mimics the args for the actual nvo to be called and passes the args to it. Be sure all nvo's are autoinstantiated.



Paul Mele
DFAS-CL/TSTB
 
Hi..

Let me give u a brief scenario:

I have an NVO say n_tr_tvm which is of type transaction.
n_tr_tvm is inherited from n_tr ( transaction object )

In the Application variable tab i have set n_tr_tvm as the transaction object.

I am in a process of converting all the inline SQL Statements to Stored Procedure due to some performance issues. And so i declare the Stored Procedures as RPC's

Due to this i have around 300-500 SP's which i require to declare as Local external functions.

Even though i create descendants.... i will not be able to access those functions coz i am accessing the ancestor n_tr_tvm and not its descendants.

As i am unable to declare more than 250 functions in n_tr_tvm,i need to declare the same in any of the ancestors.

I hope u have got my point

How do i Proceed?
 
From the way I understand it, try this -
----------------------------------------
Create four objects from your base transaction object:
n_tr_tvm1 inherited from n_tr
n_tr_tvm2 inherited from n_tr
n_tr_tvm3 inherited from n_tr
n_tr_tvm inherited from n_tr

In the Application variable tab keep n_tr_tvm as the transaction object.

Declare, say, 200 SP's as Local External Functions in each of the 3 inherited objects; n_tr_tvm1, n_tr_tvm2, n_tr_tvm3

Create new function calls in each inherited object to receive any arguments and return any values:

(n_tr_tvm1)
public function integer tr_sp001(string arg1, integer arg2)
Return sp001(arg1,arg2)
end function
...etc...

(n_tr_tvm2)
public function integer tr_sp201(string arg1)
Return sp201(arg1)
end function
...etc...

(n_tr_tvm3)
public function boolean tr_sp401( )
Return sp401( )
end function
...etc...

In the inherited object n_tr_tvm, declare the following instance vars:
n_tr_tvm1 in_tr_tvm1
n_tr_tvm2 in_tr_tvm2
n_tr_tvm3 in_tr_tvm3

In the inherited object n_tr_tvm, create new function calls for each and all of the functions within the inherited object to receive any arguments, pass them to the instance objects and return any values:

public function integer of_sp001(string arg1, integer arg2)
Return in_tr_tvm1.tr_sp001(arg1,arg2)
end function
...etc...
public function integer of_sp201(string arg1)
Return in_tr_tvm1.tr_sp201(arg1)
end function
...etc...
public function boolean of_sp401( )
Return in_tr_tvm1.tr_sp401( )
end function
...etc...

When calling the function for the SP, call the main one in n_tr_tvm:

SQLCA.of_sp201("xxx")

This is the best explanation I can give. The rest is trial and error on your part.


Paul Mele
DFAS-CL/TSTB
 
Hi Paul Mete

Just taking the Case which u have listed above.

Say i declare 200 local external functions in n_tr_tvm1
and then i declare it as a instance variable in n_tr_tvm

Just to access each local external function i need to create a function in n_tr_tvm to execute it.

if so... then i would have 200 odd functions in n_tr_tvm to access 200 odd local external functions of n_tr_tvm1 to perform the task

don't u think its too tedious a task.

but then instead i can declare it as the ancestor level, which would serve the purpose

whats ur say?

Regards,
Anjali
 
Yes, it is tedious yet it breaks it down to a manageable level.

You would have 200 odd functions in n_tr_tvm to access 200 odd local external functions of n_tr_tvm1 plus another 200 odd functions in n_tr_tvm for the 200 odd in n_tr_tvm2 and so on. In the end n_tr_tvm would have 500 or so function calls relaying arguments and return variables to and from the each of the objects.

It may be the only way to do it??? Good Luck!!


Paul Mele
DFAS-CL/TSTB
 
Bubly,

Just a thought, try to export the object, edit it from there through the text editor, then import it back to the object. It might work good luck.

- Benny
 
Hi BennyYacaco

Thanx a lot... It works..

It never flashed...

Anyways...

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top