oops.... In order to run from vantage I think you'll have to change the
filename to udDeadStock.p (and update menu structure maintenance
accordingly).
The program is written progress 4gl, which is the native language of the
progress database. It exports the records to a csv file, then tells windows
to open the file with its associated program.
You can also run the program from any workstation that has the progress
client installed, using a shortcut target line similar to the following
(you'll have to change the drive letter, EPIC50 service name, and
vantageservername to match your system):
V:\PROGRESS\bin\prowin32.exe -db vantage.db -N TCP -S EPIC50 -H
VANTAGESERVERNAME -p v:\vantage\ud\udDeadStock.p
Thaddeus Jacobs
Information Solutions Developer
Kinematic Automation, Inc.
mailto:
tjacobs@...
-----Original Message-----
From: Amy MacKay [mailto:
amackay@...]
Sent: Wednesday, September 04, 2002 1:02 PM
To: 'Thad Jacobs'
Subject: RE: [Vantage] Dead Inventory Report
Thanks. I tried this. When I connect it in menu structure maintenance, it
either disappears, or I get a message saying "program doesn't belong in this
folder." Can you give me more info on what type of program you sent and how
I can run it? Thank you.
Amy
Amy T. MacKay
Engineering Manager
Parkinson Technologies
amackay@...
(p) 401-762-2100 x 324
(f) 401-762-2295
-----Original Message-----
From: Thad Jacobs [mailto:
tjacobs@...]
Sent: Wednesday, September 04, 2002 3:17 PM
To: '
amackay@...'
Cc: '
vantage@yahoogroups.com'
Subject: RE: [Vantage] Dead Inventory Report
Amy,
Attached is the complete progress program file (I'm copying the group, who
won't receive the attachment).
below is the text of the code, which will probably be somewhat garbled in
transit. If anyone else wants me to send them the code, feel free to ask.
You can place the file in the vantage\ud directory and make a shortcut to it
within your vantage menu structure.
HTH,
Thaddeus Jacobs
Information Solutions Developer
Kinematic Automation, Inc.
mailto:
tjacobs@...
output to c:\vntgwork\DeadStock.csv.
def var yearago as date.
yearago = today - 365.
export delimiter "," "PartNum" "Description" "OnHandQty".
For each partbin no-lock where partbin.company = "001" and partbin.onhandqty
> 0:
find first parttran no-lock
where
parttran.company = '001' and
parttran.partnum = partbin.partnum and
parttran.trandate GE yearago no-error.
if not available(parttran) then do:
find part no-lock of partbin.
export delimiter "," partbin.partnum part.partdescription
partbin.onhandqty.
end.
end.
output close.
run opendoc("c:\vntgwork\deadstock.csv.").
PROCEDURE OpenDoc:
DEF INPUT PARAM cFileName AS CHAR NO-UNDO.
DEF VARIABLE cParams AS CHAR NO-UNDO initial "".
DEF VARIABLE cDirectory AS CHAR NO-UNDO initial "".
DEF VARIABLE lPrint AS LOG NO-UNDO initial false.
&SCOPED-DEFINE SE_ERR_NOASSOC 31
&SCOPED-DEFINE SE_ERR_ASSOCINCOMPLETE 27
DEF VAR iInstance AS INT NO-UNDO.
DEF VAR cWorkDirectory AS CHAR NO-UNDO.
/* in case parameter cDirectory contains a relative path
it has to be replaced by a fully-qualified path: */
ASSIGN FILE-INFO:FILE-NAME = cDirectory.
IF FILE-INFO:FULL-PATHNAME > "" THEN
cWorkDirectory = FILE-INFO:FULL-PATHNAME.
/* try to execute the document: */
RUN ShellExecuteA(INPUT 0,
INPUT (IF lPrint THEN "print":u ELSE "open":u),
INPUT cFileName,
INPUT cParams,
INPUT cWorkDirectory,
INPUT 1, /* normal mode */
OUTPUT iInstance).
/* if no associated application, run OpenAs dialog: */
IF (iInstance = {&SE_ERR_NOASSOC} OR
iInstance = {&SE_ERR_ASSOCINCOMPLETE})
AND NOT lPrint THEN DO:
/* Ignore cParams because cFileName is a document.
cParams is only valid with executables */
RUN ShellExecuteA (INPUT 0,
INPUT "open":u,
INPUT "rundll32.exe":u,
INPUT "shell32.dll,OpenAs_RunDLL ":u + cFileName,
INPUT cWorkDirectory,
INPUT 1,
OUTPUT iInstance).
END. /* if */
/* test for error: */
RUN TestErrorCode(iInstance).
IF RETURN-VALUE > "" THEN
MESSAGE RETURN-VALUE
VIEW-AS ALERT-BOX ERROR BUTTON OK.
END PROCEDURE.
/***************************************************************************
*/
PROCEDURE ShellExecuteA EXTERNAL "shell32":U :
DEFINE INPUT PARAMETER HWND AS LONG.
DEFINE INPUT PARAMETER lpOperation AS CHAR.
DEFINE INPUT PARAMETER lpFile AS CHAR.
DEFINE INPUT PARAMETER lpParameters AS CHAR.
DEFINE INPUT PARAMETER lpDirectory AS CHAR.
DEFINE INPUT PARAMETER nShowCmd AS LONG.
DEFINE RETURN PARAMETER hInstance AS LONG.
END PROCEDURE.
PROCEDURE TestErrorCode :
DEFINE INPUT PARAMETER iCode AS INTEGER.
DEF VAR cTxt AS CHAR NO-UNDO.
IF iCode < 0 OR iCode > 32 THEN RETURN "". /* no error */
CASE iCode :
WHEN 0 THEN cTxt = "The operating system is out of memory or
resources.":T132.
WHEN 2 THEN cTxt = "The specified file was not found":T132.
WHEN 3 THEN cTxt = "The specified path was not found.":T132.
WHEN 5 THEN cTxt = "The operating system denied access to the specified
file.":T132.
WHEN 8 THEN cTxt = "There was not enough memory to complete the
operation.":T132.
WHEN 10 THEN cTxt = "Wrong Windows version":T132.
WHEN 11 THEN cTxt = "The .EXE file is invalid (non-Win32 .EXE or error in
.EXE image).":T132.
WHEN 12 THEN cTxt = "Application was designed for a different operating
system.":T132.
WHEN 13 THEN cTxt = "Application was designed for MS-DOS 4.0.":T132.
WHEN 15 THEN cTxt = "Attempt to load a real-mode program.":T132.
WHEN 16 THEN cTxt = "Attempt to load a second instance of an application
with non-readonly data segments.":T132.
WHEN 19 THEN cTxt = "Attempt to load a compressed application file.":T132.
WHEN 20 THEN cTxt = "Dynamic-link library (DLL) file failure.":T132.
WHEN 26 THEN cTxt = "A sharing violation occurred.":T132.
WHEN 27 THEN cTxt = "The filename association is incomplete or
invalid.":T132.
WHEN 28 THEN cTxt = "The DDE transaction could not be completed because
the request timed out.":T132.
WHEN 29 THEN cTxt = "The DDE transaction failed.":T132.
WHEN 30 THEN cTxt = "The DDE transaction could not be completed because
other DDE transactions were being processed.":T132.
WHEN 31 THEN cTxt = "There is no application associated with the given
filename extension.":T132.
WHEN 32 THEN cTxt = "The specified dynamic-link library was not
found.":T132.
OTHERWISE cTxt = "Undocumented error code returned":T132.
END.
RETURN cTxt.
END PROCEDURE.