19. marts 2007 - 15:46
Der er
7 kommentarer og
1 løsning
Edit og edlin
Hej med jer
Jeg har porteret et script over fra windows XP som bruger edlin, mend windows 2003 server understøtter ikke denne kommando og for den sags skyld heller dens afløser, edit.
Er der nogle som har en ide til hvilken kommando der kan benyttes i stedet?
19. marts 2007 - 16:11
#2
of course
@REM: compall.bat DOS/Windows batch command file to compile Forms
@goto endcomments
This is a DOS batch command file designed to compile all forms
and PLL libraries in a single directory (folder). (Only form
SIRF0001.fmb is skipped -- it is a reference object library, not a
form to be run).
This file and all forms and PLL libraries to be compiled should be
in the same folder. If forms need to be compiled against different
user schemas, they should be separated into different folders.
Required PLL libraries and the 'SI' reference form SIRF0001.fmb can
be located elswhere in the Forms_path used by the operating system
when compiling forms. They do not need to be included in this folder.
Note: If different versions of a PLL library exist, place the one
to be used in the folder along with the forms being compiled.
Before using this batch command file, change the two SET commands
below. The first is your Oracle logon string. The second SET
command may be ok, but if not, it must be the path and program name
of the Forms compiler program. (Note that if either of these SET
commands is incorrect, the compile will fail but the compiler error
file (example S01.err) will not be created.)
To do a compile:
Start a DOS command window: Start, Run, cmd.exe
CD (change directory) to the appropriate directory (folder)
Example: CD C:\orant\forms90\fmb90\atst
Enter DIR to see a list of all files in the directory.
Try compiling a single form first by entering:
Compall YourFmbName
To compile all libraries and forms, just enter:
Compall
When you compile all, file compall.err is created
listing forms and libraries that failed to compile.
----------------------------------------------------------------------
:endcomments
@ECHO OFF
SET Orauser=xxxx/yyyy@zzzz
SET compile=frmcmp
REM: --- Build control files ---
goto skipCz1
-- The next 5 lines are extracted into compz1.bat
REM: ---- Start compz1.bat ----------
echo call compz3 %1 > compz2.bat
edlin compz2.bat < compz2.edi > compx1
call compz2
REM: ---- End compz1.bat ------------
:skipCz1
REM: These lines create edlin command file compz1.edi
REM: They delete lines from the copy of this file to
REM: create compz1.bat.
echo 1,#S-- Start compz1.bat -->compz1.edi
echo 1,-1D >>compz1.edi
echo 1,#S-- End compz1.bat --->>compz1.edi
echo +1,#D >>compz1.edi
echo E >>compz1.edi
REM: copy compall.bat to compz1.bat, then remove all but 3 lines
copy compall.bat compz1.bat >compx1
edlin compz1.bat < compz1.edi >compx1
del compz1.bak
del compz1.edi
del compx1
REM: next 3 lines create an edlin command file, compz2.edi, which is
REM: used repeatedly to remove the extension from each file name
REM: parameter
echo 1R.fmb>compz2.edi
echo 1R.FMB>>compz2.edi
echo 1R.pll>>compz2.edi
echo 1R.PLL>>compz2.edi
echo E >>compz2.edi
goto skip2
-- The next ~50 lines are extracted into compZ3.bat to do the main
-- compile process for each form or library
REM: ---- Start compz3.bat ---------- %1
del compx1
If exist %1.err DEL %1.err
REM -- do not compile reference library form SIRF001
if %1 == SIRF0001 GOTO end
if exist %1.pll GOTO comppll
If exist %1.fmb GOTO compfmb
REM --here if file not found
ECHO ERROR: File not found -- %1.fmb
goto end
:comppll
rem --- compiles PLL library here ---
If exist %1.plx DEL %1.plx
%compile% %1 %orauser% Module_Type=LIBRARY Strip_Source=YES Output_File=%1 Batch=YES Window_State=Minimize
If exist %1.plx GOTO OkCmp1
ECHO ERROR: Compile failed -- %1
ECHO ERROR: Compile failed -- %1 >>compall.err
Goto compfmb
:OkCmp1
If exist %1.err DEL %1.err
ECHO ------- Compile OK -- %1.pll
:compfmb
If not exist %1.fmb GOTO end
rem --- Compiles Form here ---
If exist %1.fmx DEL %1.fmx
%compile% %1 %Orauser% Batch=YES Window_State=Minimize
If exist %1.fmx GOTO OkCmp2
:compfail
Rem --here if compile failed
ECHO ERROR: Compile failed -- %1
ECHO ERROR: Compile failed -- %1 >>compall.err
goto end
:OkCmp2
If exist %1.err DEL %1.err
ECHO ------- Compile OK -- %1.fmb
move %1.fmx ../release/%1.fmx
move %1.fmb ../../source/%1.fmb
:end
REM: ---- End compz3.bat ------------ %1
:skip2
REM: These lines create edlin command file compz3.edi
REM: They delete lines from the copy of this file to
REM: create comp3z.bat.
echo 1,#S-- Start compz3.bat -->compz3.edi
echo 1,-1D >>compz3.edi
echo 1,#S-- End compz3.bat --->>compz3.edi
echo +1,#D >>compz3.edi
echo E >>compz3.edi
copy compall.bat compz3.bat >compx1
edlin compz3.bat < compz3.edi >compx1
del compz3.bak
del compz3.edi
del compx1
REM: ---- Now start compile loop ----
if exist compall.err DEL compall.err
REM: if %1 parm set, just compile that form, otherwise do all
if %1* == * GOTO compall
call compz1 %1
del compz*.*
echo ---- Compall completed.
goto endcomp
:compall
rem Echo -- Ready to compile all PLL Libraries and all forms.
rem Echo -- Make sure no forms are running.
rem Echo -- Press Ctrl+C to cancel
rem Pause
REM: This loops through all .pll and .fmb files:
FOR %%F in (*.pll *.fmb) do call compz1 %%F
del compz*.*
if not exist compall.err echo All forms compiled ok>compall.err
echo ---- Compall completed. Check compall.err
:endcomp
SET Orauser=
REM: ----- End of Compall.bat ----------
Slettet bruger
19. marts 2007 - 16:19
#4
Windows Server 2003 HAR edlin. Men kategorien er Windows 2000 Server, om den har ved jeg ikke.
:-)