How can i call a function whose name will be known only at run time
how can i make a call to a function whose name will be known only at run time
Instead, have a function - we should say method -
with a known name, taking a string as argument.Or, specified classes with known names and a no-arg
c'tor that implement a mutual interface, so you can
grab an instance using forName/newInstance, cast the
reference and invoke the interface's doMagic() method.@OP: Best you describe your actual problem, then we could help you with a better solution maybe.
-Puce
Similar Messages
-
How can i invole a function whose name I don't know until excecution time
Hello,
I would like to invoke a function in my jsp file but I don't know the name until it gets executed (the user enters part of the function name).
The name of the method is made of "proc_" + something specified during the excecution.
Now, I need to call this function (defined in a JavaBean).... but I don't have a clue of how doing it.
All the functions proc_..... are defined the same way:
public String proc_...... (String params)
Could you tell me how I could do it?THank you to everybody for your help. I had a look at the tutorial but I must admit it was not that clear to me... I am afraid I did not seem to find something close to what I needed.... I need more help from the experts.
Let me give you more details.
I have some stored procedures called update_<table_name> and create_<table_name>. All those procedures will return a string and will have a string as parameter.
I have a java class called for instance myProc.java. Inside this class, I would like to have something like:
public String[] update(String tableName, String params)
..... call to the stored procedure update_<tableName> with the parameters.
.... get the String as return.
public String[] create(String tableName, String params)
..... call to the stored procedure create_<tableName> with the parameters.
.... get the String as return.
Now, I have a jsp file that will call the class using something like:
String[] res= conn.create(<table_name>, <params>);
COuld you help me on this?
THanks
Elisabeth -
Call a function whose name will not be known before run time
how can i make a call to a function whose name will not be known to me before run time.
how can i make a call to a function whose name will
not be known to me before run time.That smells like a design-flaw! Care to explain what it is you're trying to do exactly? Perhaps I, or someone else, can suggest another (maybe even better/easier) approach. -
How can I call a function from a procedure
I have a function named: f_calc_value which return the variable v_result. This function is part of a package.
How can I call this function from a new procedure I am creating?
Thanksor refer this theread....calling function from procedure
-
Can I Execute a function whose name is stored in a string variable?
Can I execute a function whose name is stored in a string variable?
Like
Depending on the condition I will stroed the name of the function in a string variable. Then using that string variable i want to execute the function.
String str=��
iVal an int can take ne value
Switch(iVal)
Case 1:
str=�test1()�;
Case 2:
str=�test2()�;
I want whatever function name is in str to be executed.
----------------------------------------------------------------------------------For just executing a method or two, reflection might be easier than beanshell (or it might not). For executing entire scripts, beanshell will be preferable over reflection.
(I assume beanshell uses reflection under the hood, but I've never bothered to peek.) -
How can we call actionscript functions from js
hi
how can we call Action script function from js file . i
tried ExternalInterface. add Callback() .but it throws an error .is
there any other chance to call action script method .thnx in
advanceangadala,
some people have found it is good to include the full
qualification path, ie
if (flash.external.ExternalInterface.available)
flash.external.ExternalInterface.addCallback("ext_method_name",int_method_name);
} // if (flash.external.ExternalInterface.available)
There are also browser differences which affect how you find
the Flex application object which are documented at
http://www.adobe.com/livedocs/flex/3/html/help.html?content=passingarguments_5.html
Richard -
How can i call a function of a swf-file which is embedded as a Resource in 3D-Annotation?
Hi.
I use a Flash-menu as an embedded *.swf in a 3D-Annotation. Now i want to trigger one of the ActionScript-Function out of the 3D-Annotation.
How can i get access to that function?
Cause of it is embedded, the callAS() Methods still not possible. But how else can i do that?
Can u give me a simple example? How is the usability of Flashvariable in the Ressource-Tab of 3d-Annotation?
Kind regards
FlorianIt depends to some extent on how your SWF has been bound to the 3D scene. If you have bound it using a script, then you have a FlashMovie object that has a .call() method - but if you've attached it to something using the binding option on the Resources panel you will need to collect a reference first. If you know you are going to talk to the SWF it's best to bind it using JavaScript.
Let us assume you have a SWF in the resources collection but it's not bound to anything. In the 3D scene there is an object called 'cube' on which the SWF must appear as a material, and the SWF has declared a function to the ExternalInterface engine that is called "myFunction", which expects a string as a variable. Here's what you would put in the script attached to the 3D scene:
var fm = new FlashMovie("demo.swf");
var matl = scene.meshes.getByName("cube").material;
matl.useFlashMovie(fm);
fm.call("myFunction","hello");
The call() method is strictly typed - for example if your AS function expects a boolean and you sent it a string, it will not execute. There is also a limit on the possible returned variables - e.g. you cannot send back an Object.
Note that commands sent in the other direction using ActionScript's ExternalInterface.call() method are targeted at document-level by default, not at the 3D API - so if your AS is trying to call something it must exist as a document-level JavaScript function. It is possible to divert this traffic into the 3D API using the FlashEventHandler object, but it gets complicated as your code must implement XML encoding of the traffic - this is done automatically by the document-level script but not by the 3D API.
To answer your second question, in the resources dialog you can define the FlashVars string which is passed to the SWF when it loads - this is the same URL-encoded set of variables that you would send to a SWF when embedding it in an HTML page. It's a static string; you cannot read or edit it with JavaScript but this means it will still work if the user disables the JavaScript engine. -
How can I call a function via two different eventListener, is it possible?
Hi...
I want to call one function two different way... I write following code, but an error appears..
Could you help me.. ?
Thanks...!
/******************************** LET'S CALL VIA TWO DIFFERENT EVENTLISTENER A FUNCTION ***********************************************/
var trigger:Timer = new Timer(1000, 10);
function showAll(evt:TimerEvent, olay:MouseEvent):void{
/* code blocks */
increase_btn.addEventListener(MouseEvent.CLICK, showAll);
trigger.addEventListener(TimerEvent.TIMER, showAll);
trigger.start();
Gürkan Şahin
Code Developer/Coder
Turkeyvar trigger:Timer = new Timer(1000, 10);
function showAll(evt:*):void{
/* code blocks */
increase_btn.addEventListener(MouseEvent.CLICK, showAll);
trigger.addEventListener(TimerEvent.TIMER, showAll);
trigger.start();
Just change the showAll as shown - * is a wildcard - any object/event will work.
You can also do like:
function showAll(evt:* = null):void{
By putting the = null you can call it with the events or just call it like showAll(); if you need. -
How can I call a function in C or C++
hello friends, I want to write a prog. in Java to call a function written in C or C++ without disturbing the c/c++ function
thanksUse the Java Native Interface (JNI). See the Java Tutorial at http://www.javasoft.com/docs/books/tutorial/native1.1/index.html
-
How can i call javascript function with out internet connection?
I have trying to call javascript function through ExternalInterface. But flash player recomonding to have internet connectivity. i have allredy used allowscript="always" .
first, allow the folder that contains your flash files to connect to the internet by adjusting your security settings:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
then try the following in a swf and open the published html in your browser to test:
import flash.external.ExternalInterface
ExternalInterface.call("function(){alert('test');}") -
How can i find (Debug - method) the flow of program in workflow at run time
Hi All,
I working in Workflow monitoring. When a workflow is set into error in SWPR , i need to analyse the error and report it. In many cases the error happens in the method of class / BOR. So i could not find out the what happens inside the method. I am doing this in an productive environment.i am not given to Run any METHOD or BOR or CLASS ? How can i make my workflow monitoring better to show exact error ?
Thanks in advance !
Richard ADear Richard,
You cannot debug a method by directly setting a break point as we do normally.....u can do this by
just putting an infinite loop at the point where u want to set the debug point inside the method.
Execute the workflow where this method is being used.
Then go to SM50, here you will find your method which has gone into infinite loop.I debug mode change the value of the variable so that it can move ahead of the infinite loop.
Now you can debug easily and find out where the problem lies.
Do reply back in case of any query or even if yr problem is resolved.
Regards,
Geet -
How can I creat a control button that will allow the vi to run?
Instead of pressing the run button, I want to creat my own run button that will allow my vi to run.
Any idea?
Thank youFirst you need to set the VI to Run When Opened (VI Properties>Execution). Then you create a front panel Boolean. On the diagram what you need to do is have some sort of idle state where nothing is done until the Boolean is pressed. It could be a separate while loop that doesn't exit until the Boolean is pressed, an Event Structure, or as part of a state machine. Look at the shippings examples Queued Message Handler, New Event Handler, Using Buttons for Options to name just a few.
-
How can I call a function/procedure in VBA?
Hallo,
can somebody help me with this topic? I have vba-code and wanna call a oracle-procedure/function. Does this work? And how does this work?
Thanks, KatrinHallo,
now I tried to reach my aim with a procedure and a trigger but I get error-messages.
create or replace procedure updateNutzGeo (objnr integer, kat integer) AS
sqlStmt varchar2(500);
begin
sqlStmt := 'UPDATE NUTZUNG SET GEOMETRIE=(SELECT F'||Kat||'_GEOM FROM UG_F'||Kat||'_GEOM F, Nutzung N WHERE N.OBJNR='||Objnr||' AND F.F'||Kat||'_OBJNR='||Objnr||' AND GETFEATUREID(F.F'||Kat||'_FID) IN(SELECT MSLINK FROM FEATURE WHERE FCODE like '%0000')) WHERE N.Objnr='||Objnr||'';
EXECUTE IMMEDIATE sqlStmt;
end;
create or replace trigger update_nutz_geo_aft_upd
before insert or update on nutzung
for each row
begin
updateNutzGeo(:new.objnr,:new.kategorie);
end;
The error-messages I get:
ORA-00904: invalid columnname
ORA-06512: in "pilot.updatenutzgeo", line 5
ORA-06512: in "pilot.Update_Nutz_geo_Aft_Upd", line2
ORA-04088: Error while execution of trigger pilot.update_nutz_geo_aft_upd
Any help? -
How can i call my function from a procedure?
My function is:
create or replace FUNCTION test(pAttributeName IN NUMBER)
RETURN VARCHAR2 IS
ret VARCHAR2(100) := NULL;
VAR n1 NUMBER
BEGIN
SELECT Klartext INTO ret FROM piclist WHERE ATTRIBUTNAME = 'voltage_level' and PICLIST_ID =pAttributeName;
RETURN ret;
Insert into BM_ATTRIB(ID_ERFASSUNG,ID_ATTRIBNAME,ATTRIB_CHA,BM_ATTRIB_ID) VALUES(1,1,ret,1);
exception
when no_data_found then
ret := 'AAA' ------- you can return any default value,if you like
--return ret;
return NULL;
when others then
dbms_output.put_line('Exception:'||sqlerrm);
End;
I want to call it from a procedure!
Please help!
Nicoleif the function is in the same package as the procedure then merely specify the function name and parameters:
retcode := functionname(param1..paramn);
If in another package then:
retcode := packagename.functionname(param1..paramn);
If the function is in another schema then you need to grant execute rights to the package/function to the schema trying to run the function:
grant execute on packagename/functionname to otherschema;
you need to be the package/function schema owner to do the above grant. -
How can I call the function module of the ECC when I save the campaign?
HI Experts!
I want to call function module of the ECC when I click the save button in the campaign view,A badi or userexit is needed,but I don't find, can you tell me which badi or userexit is used to implement?Thanks a lot.
I have tried,but it can't do.
who can tell me which badi and detailed implementation step?
waiting on line.
Maybe you are looking for
-
Can i install OS X mountain lion on the same computer as yosemite (mac pro late 2013)
i want to partition my main drive that currently has OS X yosemite and have two operating systems, oner on each partition . Mountain lion and yosemite.I want to use ProTools 10 on Mountain lion and Protools 11 with Yosemite. I'm collaborating with a
-
E-REC EHP5 - Prerequisites for MSS user for Create Requisition request
We are implementing E-REC EHP5. As a MSS user when line manager tries to create requisition request on portal, although it takes on a new page called "Stat Processes" we are getting error "no data available" and hence can not proceed on that page. W
-
Oracle apps functional queries
hi , I got some questions. if anybody knows please answer the following .. it will be useful for me. 1.What is the difference between accounting calendar & inventory calendar? 2.Explain the Business process? 3.What is Business group ,and draw the mul
-
Linux 920 Database Disk1 Problems
Hi After spending nearly 3 days downloading 9i for linux I ended up with Disk1 being a corrupted gzip.... Very annoying. Don't know whether this was my problem or not, but now I can't download lnx_920_disk1.cpio.gz again with resume supported. disk2
-
After apple repair TM creates new backup set instead of recognizing past on
I took my computer in to the apple store for a repair and now it refuses to use my old time machine backups and created a completely new set that took up another 80GB on my harddrive. is there any way to get it to use my old backup, because I can't a