Re: Operating system commands from within Forms 5.
Date: Wed, 21 Oct 1998 22:58:53 GMT
Message-ID: <70lovd$3qo$1_at_nnrp1.dejanews.com>
In article <70flkh$7mc$1_at_nnrp1.dejanews.com>,
igal_at_healthstreet.com wrote:
> Hello everybody, Has anyone tried to perform a copy, delete or any other
> operating system commands from within Forms? Specifically, I have to perform a
> simple copy of a file from a floppy drive to the hard disk in a Windows NT
> environement. I suppose I have to use the USER_EXIT built-in, and DLL's but
> I'm not sure how and which one. Any help would be appreciated, Igal
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
If you look in c:\orant\devdem20\demo\forms (or wherever you installed Oracle), you will find a file D2KWUTIL.PLL. (It may be a part of Developer/2000)
In D2KWUTIL.PLL you will find a package WIN_API_UTILITY:
/*-------------------------------------------------------------------------*\ * WIN_API_UTILITY -> This package is concerned Helpful utility functions * Contents: * Delete_File -> Erases an O/S file * Move_File -> Moves an O/S file * Copy_File -> Copies an O/S file * Generate_Temp_Filename -> The "official" way of getting a * Temporary filename. * Get_Active_Window -> Useful for getting Window Handles * when not in Forms (which supplies them * for you) * Play_WAV -> Plays a Sound file * Sleep -> Suspends the application * InterruptCheck -> Check for "Cancel" Mouse Click intight loops
* * Dependancies: * WIN_API_ENVIRONMENT * WIN_API \*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*\ * Copy_File -> Copies the specified file * Arguments: * OldFileName -> The location and name of the file to Copy * NewFileName -> The new location and name for the copy of the file * AllowOverWrite -> TRUE or FALSE(Default) If FALSE, then if the NewFileName * already exists then the move will fail. If TRUE the existing * file will just be overwritten. * RaiseExceptions -> TRUE or FALSE(Default) If set to true, then if the * command is not successful (e.g the file does not exist) then the explicit exception * NO_DATA_FOUND will be raised. * Returns: * (NONE) \*-------------------------------------------------------------------------*/ PROCEDURE Copy_File ( OldFileName IN VARCHAR2, NewFileName IN VARCHAR2, AllowOverWrite IN BOOLEAN DEFAULT FALSE, RaiseExceptions IN BOOLEAN DEFAULT FALSE);
This works like a charm. Actually, D2KWUTIL is full of really useful stuff; I'm really grateful to the guys at Oracle for providing it.
/Claes
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Oct 22 1998 - 00:58:53 CEST