How to detect an external application close event?
Hello,
I have an executable running at startup (scheduled task) and always
staying alive on my server. When the server is rebooted, I would like
to take some actions (write in a event log, etc) before my application
is closed by windows.
So how can I detect that Windows is closing and that it's time to do the associate actions before the closing.
I've tried the 'Application close event' in an event loop but doesn't seems to work.
I'm using labview 8.2 on Windows server 2003.
Thanks in advance!!
Vincent
I tied this and it did capture the application close event. What I did was while running LabVIEW in developer mode I used Windows Task Manager to kill the process. It did throw an Application Close event. I don't have time to try other cases like shutdown or what happens if it is an EXE but hope this helps.
Matthew Fitzsimons
Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
Attachments:
appClose.vi 13 KB
Similar Messages
-
Can't find an application close event.
I have a script that runs on the document close event. It looks like the document close event doesn't fire when the application is closed while a document is open. I checked for an application close event in the Script listener log, but there wasn't an entry for it, and the document close event wasn't present either.
The script I'm making writes a file in the same folder as the opened document that indicates that the file is in use. Then when the document is closed, the lock file is removed. It works except when you close the application. There is no document closed event firing, so the documents just close and the application shuts down without any events firing.
Is there a way know when the application is closing?
I found a possible work around that would be a huge pain. The idea is about loading a custom external library that performs cleanup when it is automatically unloaded when Photoshop closes. This is the prototype for the function that would do the work:
void ESTerminate (void );
There is another work around that invloves some button that the user has to remember to click to close the application. That would be awkward and open to user error.
I just want the document closed event to fire before the application closes. Thanks for you help!That's too bad. I don't feel like getting a whole build environment setup for CS just so I can get a pre-close event in Photoshop. I implemented a script that the user will run in order to close photoshop. I saved a shortcut to the script in "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts". The script closes each document and runs my event handler. Then it exits. Check it out, it seems to work:
#target photoshop
//user will run this script instead of hitting exit button
var MLAB_CUSTOM = new Folder($.getenv('MLAB_CUSTOM')).absoluteURI
var docs = app.documents
for(var i = docs.length-1; i >= 0; i--)
docs[i].close()
$.evalFile(MLAB_CUSTOM+"/Ps-FileLock/PsLock-OnDocClose.jsx")
photoshop.quit(); -
How to automatically invoke external applications link.
Hi,
I was wondering if anyone has any ideas on how to cause an
external application link to be selected upon portal page load.
We have a number of basic auth applications and we do not want
the user to have to click on the external applications portlet
to be authorized.
In short, can we cause a link to be selected on portal page
load?
Any ideas would be helpful...
Thanks
Tom HillsonHi jeromemonange,
Here is some information about creating hyperlinks in a PDF, both to external sources, such as a website, or to another page within the PDF: http://help.adobe.com/en_US/acrobat/X/pro/using/WS58a04a822e3e50102bd615109794195ff-7cb7.w .html
Please let us know how it goes.
Best,
Sar -
How can I execute external application?
Hi friends I want printing my barcodes a laser printer (Kyocera) it isn't a barcode printer. So I think (and I look kyocera web page my model doesn't support barcode printing in sap) print my barcodes using an external system. Before SAP we are using JollyPrint application for printing barcodes. It is using an Excel file.
I can create a excel file for this application. I must execute this (JollyPrint-it is a label application) application when I press a button. How can I execute this application?
Thanks
Mehmet
P.S. I have been writing this message with details may be somebody can give me a simple way for thisWell, I can suggest you following steps. May be it works for you .
-Create an external OS command in SM69
-Test OS command in SM49 ( <u><i>about OS command if you search in SDN youll get lot of material</i></u> )
-Create a Script at your OS level, Im assuming you might have some UNIX flavor or Sun solarias.
-Create a Shell script , which execute the printer job from OS .
-Shell script will have parameters . ( e.g. printer name, destination etc )
-set the path of shell script directory in SM69 ( the command you just created )
-Execute shell script using your ABAP program ( use FM "SXPG_COMMAND_EXECUTE" )
In the ABAP program you can pass the parameters and execute the command from ABAP as a result your job will start printing on the required destination. Moreover, you can also capture the spool at OS level .
FYI
For UNIX script, if you search in www.google.com ( UNIX forums) . youll get shell script .
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise" -
How to detect if external display is present
I need my code to evaluate whether an external display is connected via a mini-display port.
Ideally, I'd like to do this by having a bash command that determines a boolean True/False value for the presence of a file. I'm just not sure what file I should be looking for, presumably something in /dev/
Any suggestions what it should be, or suggestions of a better way to make the determination (anything in applescript, bash, objective-c, or plain-old c will do)?
TIAThis seems to cover the same issue:
http://macscripter.net/viewtopic.php?id=28627
From what I can tell at the moment, a full answer is going to have to be done in Obj-C, but a short Applescript like this will at least get the number of displays connected:
tell application "Image Events"
launch
get properties of every display
quit
end tell -
How to detect if specific applications in an office suite are installed?
Here is the scenario. I have deployed made a version of Office 2013 available to a group of users in my enterprise. That customized version has an MSP that had several applications disabled like Outlook and Access for example. I now want
to roll out office everwhere with Outlook enabled. I know that I can, and will, use a new MSP for the existing installations to enable Outlook and I know that I will have a new MSP for machines that do not have any version of Office 2013 installed.
How do I, programatically, detect on a machine which apps/components of Office are installed?
I am using SCCM 2012 to deploy and for my detection method cannot simply use the MSI product code of Office since the machines that already have office installed (without outlook) will pass the detection method and thus never run. I really do not want
to do something kludgy like look for outlook.exe or something. I prefer to really detect if the component is there. Would I look for the installed features of the MSI? If so which features...there are several of Outlook that I see?
Do I look for all of them?Hi,
Only a single instance of Outlook can be installed on the machine. To determine if Outlook is installed, you might need to check below registry key, and that should be sufficient to check for the existence:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE
Or you can try below function:
Type officeType = Type.GetTypeFromProgID("Outlook.Application");
if (officeType == null)
// Outlook is not installed.
else
// Outlook is installed.
(Quoted from
http://www.codeproject.com/Tips/692610/How-to-Check-Whether-Outlook-is-Installed-in-the-S )
Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
Also, detect if Outlook is installed programatically is not supported in this forum. Since you are using SCCM 2012, I would suggest you to post your questions in the forum for System Center. There are lots of similar discussions there:
http://social.technet.microsoft.com/Forums/systemcenter/en-US/home?category=configurationmanager
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
Thanks,
Ethan Hua CHN
Forum Support
Come back and mark the replies as answers if they help and unmark them if they provide no help.
If you have any feedback on our support, please click
here -
How to detect last external item loaded?
I can't get my head around this. I know there's a clever way to do this but none of my ideas seem to be the solution. I'd like to dispatch an event when there are no more items to be loaded. I'm working with Drupal and AMFPHP and loading some nodes. The number of nodes may vary from day to day so I need a way to know when the last one has loaded.
In the code below, I am building an array to use elsewhere in the application. Once all nodes have finished loading I'd like to know what the final length of portfolioItems is.
public function onNodeLoad( node:Object )
//trace("Node loaded");
if (node.nid == 2) {
about.aboutText_txt.htmlText = node.body;
}else {
var nodeStr:String=baseURL;
nodeStr+=node.flashnode["filepath"];
portfolioItems.push(nodeStr);
portfolio.portItems = portfolioItems;Aha, good point! Thanks for the knock in the head.
I can set a counter on the event handler for the View Load, which is where the node loading gets kicked off. Then check to see if I've reached that last item inside the Node Load handler. I'm posting if anyone else needs an example like this.
var loadCounter:Number = 0;
// Called when a view gets loaded.
public function onViewLoad( _view:Object )
// Iterate through all of the nodes.
for each (var node:Object in _view) {
loadCounter ++;
// Call Drupal to get the node.
drupal.loadNode(node.nid, onNodeLoad);
showAllElements();
// Called when Drupal returns with our node.
public function onNodeLoad( node:Object )
if (node.nid == 2) {
//trace(node.body);
about.aboutText_txt.htmlText = node.body;
}else{
var nodeStr:String=baseURL;
nodeStr+=node.flashnode["filepath"];
portfolioItems.push(nodeStr);
if(portfolioItems.length == loadCounter){
portfolio = new Portfolio();
addPortfolio();
portfolio.portItems = portfolioItems; -
How to detect that Illustrator.Application is fully loaded (VB)
Does anyone have a trick that they use to determine that the app is fully loaded? Is there a method available that I might be missing? I manage most of the time but I'd like to get this problem trapped. Looking for a method available in the Illustrator Scripting API preferably. Within VB Try/Catch isn't working in this instance...
Thank you! -TT
(CC2014, VB.NET on WIndows 8.1.)So after a bit more investigation and understanding (and some sleep), I came up with some VB code to resolve my dilemma. Here's the code:
Truth be told, my biggest problem was self-inflicted, as I somehow had the VS UI set to throw exceptions even on handled exceptions, leaving pretty much no one to blame but myself. :-(
imagecollection wrote:
i Should do more with vb as it has more external potential then JS.
let us know how you go.
Qwertyfly... -- thanks for your reply here. I truly hope that you do more in VB, as it gets pretty lonely here on this forum. :-) Please let me know if you ever decide to get involved with VB. I'd be happy to help get you started. :-)
-TT -
How to call an external application from the current one
Hi Guys,
Im not sure if/how this is possible.
For example:
I have two projects : Project1 and Project 2.
When I click on a button in Project2, Project1 needs to be launced. That is, the Main class of Project1 needs to be triggered.
How do I do this? I have tried everything.
Kind Regards,
ChristiaanThere is no problem with handling multiple Frame with a javaFX app. Some features are needed to improve that, like AlwaysOnTop, modal, ...
For exemple it can be used like a splashscreen.
If your question was about launching anything on your machine, the regular java API can do that. -
How can i run external application without specifying the full path?
for example, ms word executable file is winword.exe, but in java i am using the following command:
Runtime.getRuntime().exec("\"C:\\Program Files\\Microsoft Office\\Office10\\winword.exe\");
the thing is, i dont know where ms word is installed on every machine, so rather than making an assumption, do you know how i can run ms word without specifying the full path?
thanks1) You could ask the user to tell you where it's at (and remember for next time)
2) You could do a file search for it (and remember it for next time) -
How to run an external application from PL/SQL code?
Hi,
I want to call an application like "Notepad" from PL/SQL code in a Windows2000 server. Is there any way to do that?
Thanks, best regards.
Paulo.declare
r varchar(4000);
begin
dbms_java.set_output(10000);
system_util.runshell('sh /ora9/runBackup.sh', r);
dbms_output.put_line(r);
end;
System_util package is
CREATE OR REPLACE PACKAGE System_Util IS
*System: Generic
*Package Name: System_util
*Description: This is an open source package which holds regular used
* methods by developers and dba's.
*Created by: Rae Smith
*Created Date: 27/06/2001
*Notes: This ia an free open source package that holds no warranty and
* therefore no-one connected to the development of this package
* can be made reasponsible for any outcomes by it's use.
MODIFICATION LOG**************************************************************
*DETAILS DATE VERS CHANGED BY
*===============================================================================
*Created 27-06-2001 1.0 Rae Smith
/********************************* Public Methhods ***************************************/
--- getDir returns the first directory value held in the init.ora file
FUNCTION getDir RETURN VARCHAR2;
--- getPrev.. returns the prevoise day from a gievn date
FUNCTION getPrevSat(pDate IN DATE) RETURN DATE;
FUNCTION getPrevSun(pDate IN DATE) RETURN DATE;
FUNCTION getPrevMon(pDate IN DATE) RETURN DATE;
FUNCTION getPrevTue(pDate IN DATE) RETURN DATE;
FUNCTION getPrevWed(pDate IN DATE) RETURN DATE;
FUNCTION getPrevThu(pDate IN DATE) RETURN DATE;
FUNCTION getPrevFri(pDate IN DATE) RETURN DATE;
--- isNumber returns TRUE or FALSE depending on a datatype passed
FUNCTION isNumber(pnumber IN VARCHAR2) RETURN BOOLEAN;
FUNCTION isNumber(pnumber IN NUMBER) RETURN BOOLEAN;
FUNCTION isNumber(pnumber IN DATE) RETURN BOOLEAN;
--- The writeFile allow you to write data to a file
--- writeFile has 2 Versions
--- v1 pass in the file name and the text to write to a file.
--- v2 pass in the file name, dbms_sql.varhar2s object
--- and the amount of rows to procces at a time
--- This enables you to write to afile in batch mode
PROCEDURE writeFile(pName IN VARCHAR2, pText IN VARCHAR2);
PROCEDURE writeFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER);
--- The appendFile methods allow you to append data to a file
--- This also has the inteligents to create the file if ts does not exist.
--- appendFile has 2 Versions
--- v1 pass in the file name and the text to write to a file.
--- v2 pass in the file name, dbms_sql.varhar2s object
--- and the amount of rows to procces at a time
--- This enables you to write to afile in batch mode
PROCEDURE appendFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER);
PROCEDURE appendFile(pName IN VARCHAR2, pText IN VARCHAR2);
--- The clearFile clears the data from a file.
PROCEDURE clearFile(pName IN VARCHAR2);
--- checkSyntax is a quick syntax checker for sql statements the is a limit to
--- the size used in the statement. If you have a error with
--- a statement then pass in the statement watch as it displays
--- the point where the error arose.
PROCEDURE checkSyntax(pSql IN VARCHAR2);
--- isEmpty this returns TRUE or FALSE
FUNCTION isEmpty(pValue IN VARCHAR2) RETURN BOOLEAN;
--- getTimeInMins returns the time in minutes for a specified date
FUNCTION getTimeInMins (pDate IN DATE) RETURN NUMBER;
--PROCEDURE get_time_in_mins (pDate IN DATE);
--- incDate returns a specified date incremented by value
FUNCTION incDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE;
--- decDate returns a specified date decremented by value
FUNCTION decDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE;
--- getTime returns the time in milliseconds
FUNCTION getTime RETURN NUMBER;
--- daysDiff returns the amount of days between two values
FUNCTION daysDiff(pHigh IN DATE, pLow IN DATE) RETURN NUMBER;
--- difference returns the diffeence between two numbers always
--- taking the lowest away from the highest
FUNCTION difference(pAnum IN NUMBER,pBnum IN NUMBER)RETURN NUMBER;
--- total returns the value of two numbers added together
FUNCTION total(pAnum IN NUMBER, pBnum IN NUMBER)RETURN NUMBER;
--- numberToWords returns the string for a number passed in
FUNCTION numberToWords(pNumb IN NUMBER) RETURN VARCHAR2;
--- runShell allows you to run operating commands from pl/sql
--- Only available with 8i
--- PROCEDURE runShell(pCmnd IN VARCHAR2, pErrMsg IN OUT VARCHAR2);
/**************************** Public Vaiables *******************************/
--- Public variable that holds the operating system directory
--- that the can be written to from withing the database.
vDir VARCHAR2(50);
END;
CREATE OR REPLACE PACKAGE BODY System_Util IS
FUNCTION getDir RETURN VARCHAR2
IS
BEGIN
RETURN vDir;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...System_Util.getDir');
RAISE;
END getDir;
/**** Private module to get the first directory for utl_file to use ****/
PROCEDURE getDir
IS
CURSOR cDir(p1 IN VARCHAR2)
IS
SELECT DECODE(INSTR(value, ','), 0, value, SUBSTR(value, 1, INSTR(value, ',')-1)) dir
FROM v$parameter
WHERE name = p1;
BEGIN
FOR rDir IN cDir('utl_file_dir') LOOP
vDir := rDir.dir;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...System_Util.getDir');
RAISE;
END getDir;
FUNCTION getPrevDate(pDate IN DATE, pDay IN VARCHAR2) RETURN DATE
IS
BEGIN
RETURN NEXT_DAY(pDate - 7, pDay);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevDate;
FUNCTION getPrevSat(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'saturday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevSat;
FUNCTION getPrevSun(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'sunday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevSun;
FUNCTION getPrevMon(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'monday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevMon;
FUNCTION getPrevTue(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'tuesday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevTue;
FUNCTION getPrevWed(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'wednesday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevWed;
FUNCTION getPrevThu(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'thursday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevThu;
FUNCTION getPrevFri(pDate IN DATE) RETURN DATE
IS
BEGIN
RETURN getPrevDate(pDate, 'friday');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getPrevFri;
FUNCTION isNumber(pNumber IN VARCHAR2) RETURN BOOLEAN
IS
BEGIN
IF TO_NUMBER(pNumber)> 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END isNumber;
FUNCTION isNumber(pNumber IN NUMBER) RETURN BOOLEAN
IS
BEGIN
IF TO_NUMBER(pNumber) > 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END isNumber;
FUNCTION isNumber(pNumber IN DATE) RETURN BOOLEAN
IS
BEGIN
IF TO_NUMBER(TO_CHAR(pNumber, 'YYYYMMDD')) > 0 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END isNumber;
PROCEDURE writeFile(pName IN VARCHAR2, pText IN VARCHAR2)
IS
vFtype utl_file.file_type;
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName,'w');
UTL_FILE.PUT_LINE(vFtype,pText);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
UTL_FILE.FCLOSE(vFtype);
RAISE;
END writeFile;
PROCEDURE writeFile(pName IN VARCHAR2, pText IN VARCHAR2, pFtyp IN OUT utl_file.file_type)
IS
vFtype utl_file.file_type;
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName,'w');
UTL_FILE.PUT_LINE(vFtype,pText);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
UTL_FILE.FCLOSE(vFtype);
RAISE;
END writeFile;
PROCEDURE writeFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER)
IS
vFtype utl_file.file_type;
vText VARCHAR2(2000);
vCnt BINARY_INTEGER;
vRem BINARY_INTEGER;
vRowcnt PLS_INTEGER := 0;
BEGIN
vRem := MOD(pText.COUNT, pRows);
vFtype := UTL_FILE.FOPEN(vDir, pName, 'w');
vCnt := pText.FIRST;
LOOP
EXIT WHEN vCnt IS NULL;
vRowcnt := vRowcnt + 1;
IF vCnt = pText.LAST THEN
vText := vText||pText(vCnt);
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF MOD(vCnt, pRows) = 0 THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF vRowcnt = vRem THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
ELSE
vText := vText||pText(vCnt)||'\n';
END IF;
vCnt := pText.NEXT(vCnt);
END LOOP;
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...SYSTEM_UTIL.WRITE_FILE');
UTL_FILE.FCLOSE(vFtype);
RAISE;
END writeFile;
PROCEDURE appendFile(pName IN VARCHAR2, pText IN DBMS_SQL.VARCHAR2S, pRows IN PLS_INTEGER)
IS
vFtype utl_file.file_type;
vText VARCHAR2(2000);
vCnt BINARY_INTEGER;
vRem BINARY_INTEGER;
vMode VARCHAR2(2) := 'a';
vRowcnt PLS_INTEGER := 0;
BEGIN
vRem := MOD(pText.COUNT, pRows);
vFtype := UTL_FILE.FOPEN(vDir, pName, vMode);
vCnt := pText.FIRST;
LOOP
EXIT WHEN vCnt IS NULL;
vRowcnt := vRowcnt + 1;
IF vCnt = pText.LAST THEN
vText := vText||pText(vCnt);
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF MOD(vCnt, pRows) = 0 THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
vText := '';
ELSIF vRowcnt = vRem THEN
vText := vText||pText(vCnt)||'\n';
UTL_FILE.PUTF(vFtype,vText);
UTL_FILE.FFLUSH(vFtype);
ELSE
vText := vText||pText(vCnt)||'\n';
END IF;
vCnt := pText.NEXT(vCnt);
END LOOP;
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
IF vMode = 'a' THEN
writeFile(pName, pText, pRows);
ELSE
RAISE;
END IF;
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...SYSTEM_UTIL.APPENDFILE');
UTL_FILE.FCLOSE(vFtype);
RAISE;
END appendFile;
PROCEDURE appendFile(pName IN VARCHAR2, pText IN VARCHAR2)
IS
vFtype utl_file.file_type;
vMode VARCHAR2(2) := 'a';
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName, vMode);
UTL_FILE.PUTF(vFtype, pText);
UTL_FILE.FFLUSH(vFtype);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
IF vMode = 'a' THEN
writeFile(pName, pText);
ELSE
RAISE;
END IF;
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...SYSTEM_UTIL.APPENDFILE');
UTL_FILE.FCLOSE(vftype);
RAISE;
END appendFile;
PROCEDURE clearFile(pName IN VARCHAR2)
IS
vFtype utl_file.file_type;
vText VARCHAR2(2000);
vCnt BINARY_INTEGER;
vRem BINARY_INTEGER;
vRowcnt PLS_INTEGER := 0;
BEGIN
vFtype := UTL_FILE.FOPEN(vDir, pName, 'w');
UTL_FILE.PUTF(vFtype,'');
UTL_FILE.FFLUSH(vFtype);
UTL_FILE.FCLOSE(vFtype);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERROR...ERROR...System_Util.CLEARFILE');
UTL_FILE.FCLOSE(vFtype);
RAISE;
END clearFile;
PROCEDURE checkSyntax(pSql IN VARCHAR2)
IS
sqlCur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
errPos PLS_INTEGER;
sqlStmt VARCHAR2(2000);
BEGIN
sqlStmt := pSql;
DBMS_SQL.PARSE(sqlCur, sqlStmt, DBMS_SQL.NATIVE);
EXCEPTION
WHEN OTHERS THEN
errPos := DBMS_SQL.LAST_ERROR_POSITION;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
DBMS_OUTPUT.PUT_LINE(sqlStmt);
DBMS_OUTPUT.PUT_LINE(' ');
DBMS_OUTPUT.PUT_LINE(LPAD('^', errPos, '-'));
DBMS_SQL.CLOSE_CURSOR(sqlCur);
END checkSyntax;
FUNCTION isEmpty(pValue IN VARCHAR2) RETURN BOOLEAN
IS
BEGIN
IF pValue IS NULL OR pValue = '' OR pValue = ' ' THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END isEmpty;
FUNCTION getTimeInMins (pDate IN DATE) RETURN NUMBER
IS
vHours NUMBER;
vMins NUMBER;
vRetval PLS_INTEGER;
BEGIN
vHours := TO_NUMBER(TO_CHAR(pDate,'HH24'));
vMins := TO_NUMBER(TO_CHAR(pDate,'MI'));
vRetval := ((60 * vHours) + vMins);
RETURN vRetval;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getTimeInMins;
PROCEDURE getTimeInMins (pDate IN DATE)
IS
vHours NUMBER;
vMins NUMBER;
vRetval PLS_INTEGER;
BEGIN
vHours := TO_NUMBER(TO_CHAR(pDate,'HH24'));
vMins := TO_NUMBER(TO_CHAR(pDate,'MI'));
vRetval := ((60 * vHours) + vMins);
DBMS_OUTPUT.PUT_LINE('The time IN minutes IS: '||vRetval);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END getTimeInMins;
FUNCTION incDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE
IS
BEGIN
RETURN (TO_DATE(TO_CHAR(pDate + pInc, 'DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YYYY HH24:MI:SS'));
EXCEPTION
WHEN OTHERS THEN
RAISE;
END incDate;
FUNCTION decDate(pInc IN NUMBER DEFAULT .999999, pDate IN DATE DEFAULT SYSDATE) RETURN DATE
IS
BEGIN
RETURN (TO_DATE(TO_CHAR(pDate - pInc, 'DD/MM/YYYY HH24:MI:SS'), 'DD/MM/YYYY HH24:MI:SS'));
EXCEPTION
WHEN OTHERS THEN
RAISE;
END decDate;
FUNCTION getTime RETURN NUMBER
IS
BEGIN
RETURN dbms_utility.get_time;
END getTime;
FUNCTION daysDiff(pHigh IN DATE, pLow IN DATE) RETURN NUMBER
IS
vHighdate DATE;
vLowdate DATE;
BEGIN
IF pHigh > pLow THEN
vHighdate := TO_DATE(TO_CHAR(pHigh, 'YYYYMMDD'), 'YYYYMMDD');
vLowdate := TO_DATE(TO_CHAR(pLow, 'YYYYMMDD'), 'YYYYMMDD');
ELSIF pLow > pHigh THEN
vHighdate := TO_DATE(TO_CHAR(pLow, 'YYYYMMDD'), 'YYYYMMDD');
vLowdate := TO_DATE(TO_CHAR(pHigh, 'YYYYMMDD'), 'YYYYMMDD');
END IF;
RETURN (vHighdate - vLowdate);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END daysDiff;
PROCEDURE dateCheck(pDateFrom IN OUT DATE, pDateTo IN OUT DATE)
IS
/* Declare the variable to hold the "from" date */
vDateFrom DATE;
BEGIN
/* If either date_from or date_to is null then set to todays date **
** using the sysdate **
** today's DATE AND IN the correct format */
pDateFrom := NVL(pDateFrom, SYSDATE);
pDateTo := NVL(pDateTo, SYSDATE);
/* Check that the from date is not greater than the to date if so **
** use the system_util.incDate to Increment the date by 1 day */
IF (pDateFrom > pDateTo) THEN
vDateFrom := pDateFrom;
pDateTo := System_Util.incDate(1, vDateFrom);
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
/* calculates the difference of two numbers always taken the high from the low*/
FUNCTION difference(pAnum IN NUMBER, pBnum IN NUMBER)RETURN NUMBER
IS
vTotal NUMBER;
BEGIN
IF (pAnum > pBnum )OR (pAnum = pBnum)THEN
vTotal := (pAnum - pBnum);
ELSIF (pAnum < pBnum) THEN
vTotal := (pBnum - pAnum);
END IF;
RETURN (vTotal);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END difference;
/* calculates the Total of two numbers*/
FUNCTION total(pAnum IN NUMBER, pBnum IN NUMBER)RETURN NUMBER
IS
vTotal NUMBER;
BEGIN
vTotal := (pAnum + pBnum);
RETURN (vTotal);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END total;
FUNCTION numberToWords(pNumb IN NUMBER) RETURN VARCHAR2
IS
vRetval VARCHAR2(255);
vNumb PLS_INTEGER;
BEGIN
vNumb := pNumb;
vRetval := REPLACE(TO_CHAR(TO_DATE(vNumb,'j'),'jsp'),'-',' ');
RETURN (vRetval);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
/*************** Only Available on 8i ********************************\
FUNCTION Catcherr(pStr IN VARCHAR2) RETURN VARCHAR2
IS
LANGUAGE JAVA
NAME 'catchErr.run(java.lang.String) return String';
PROCEDURE runShell(pCmnd IN VARCHAR2, pErrMsg IN OUT VARCHAR2)
IS
BEGIN
pErrMsg := Catcherr(pCmnd);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END runShell;
BEGIN
getDir;
END; -
I am using Labview 8.0 and the Run Application and Close Application
VIs in the Winevent.llb. This works fine except that when certain
external applications close they pop up a dialog box asking the user to
click "Yes", "Cancel" or "OK". How can I make Labview click
the "Yes" button in this case. VB has a send keys command, but I
never really got that to work for this type of case. Thanks.Unfortunately my application was not Excel. I did however solve the problem:
I Used the Show Window.vi from WINUTIL.llb to get focus on the
Application Window, then used the Delay function in LV 8.0 to wait 0.1
sec, then used the simulate_keyboard.vi to send a return. I lost the
link to it, but this is the improved? version
(http://forums.ni.com/attachments/ni/270/837/1/simulate_keyboard_modified.vi).
Although the dialog box briefly appears and beeps it works good enough
for now.
Andy -
How to track application exit event?
I have my swf embeded in Asp.Net. I want to track application exit event. Is there any event which is called when flex application exists or unload or destroyed? I tried application close event but it is not working. I do not want events of browser close or etc because I already tried it.
Thanks,
-Chanduif you wanted to just close the window all together you could write some Javascript to close the window, then in your flex app call the function when they click the logout button
If you want to actually end it with Actionscript you could try:
public function applicationExit():void {
var exitingEvent:Event = new Event(Event.EXITING, false, true);
NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
if (!exitingEvent.isDefaultPrevented()) {
NativeApplication.nativeApplication.exit();
Source: http://livedocs.adobe.com/flex/3/html/help.html?content=app_launch_1.html
UKB -
How to detect which application connects to the in...
Hello,
I have a E71 and for a week or so the phone drains the battery quite fast.
I have seen in the journal that an wi-fi connection is opening every 2-3 minuntes for less the half a minute.
The weird thing is that the WLAN is disconected and WLAN SCAN is OFF, but the icon that shows a wi-fi connection appaers every 2-3 minutes.
So how to detect the damn application that makes wi-fi conections by my back?
Thanks!Check messaging and social media apps connection and sync settings.
‡Thank you for hitting the Blue/Green Star button‡
N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009 -
Register external application as partner application on OSSO
Hi All,
I am using OracleAS Single Sign-On. I want to integrate Stellent Universal Content Management(UCM) with OracleAS Single Sign-On.
Can someone please let me know how to achieve this?
Also I would like to know, how can I register external application as a partner application in OracleAS Single Sign-on?
Thanks & Regards,
Yash ShahHi,
Thanks for your quick response. I have gone through the document which you suggested. the document says to register through sooreg.sh script. I would like to register partner application using SSO Administration UI.
When I log in to OSSO server, I have a option of registering the partner application, there in UI I have to specify, Home URL, Success URL and Logout URL.
For me, my sso server and my application server resides on the different servers (systems). Please let me know which URLs I shoudl specify to register my partner application using UI.
I mean, I want to know what should I specify in Home URL, Success URL and Logout URL
Thanks & Regards,
Yash Shah
Maybe you are looking for
-
Sender File channel in "To be Delivered" status always- PI 7.4- ICO interface
Hello All, We are testing one Integrated Configuration Object (ICO) which is developed on PI 7.4 system (dual stack). Scenario is simple file to file and it doesnt have any ESR part (pass thru interface). Sender channel (File adapter NFS based) is pi
-
How do I create a "command-line-interface" for a game?
Hey people, For a game I need to make a DOS-like command-line-interface where the user has at least 3 options to answer with, does anyone know how to go about this? Hope someone here can help me out! Kind regards, Angela
-
Problem getting packages of swing
i want to use the following packages : com.sun.java.swing.*; com.sun.java.swing.event.*; com.sun.java.swing.table.*; i am using jdk 6 and it does not contain dese packages .can anyone please tell ,from where i can get these packages ??
-
How to configure event based ALEAUD?
I am sending idocs from BPM to R/3, and would like to know, whether it is possible to get ALEAUD confirmations back to XI in real time. At present it takes about 10 minutes to get the ALEAUDits back, and that will withhold my BPM in idle.
-
downloading lightroom5, on MAC and a message comes up with the app is an unidentified developer. can someone help me?