Log in

View Full Version : Abstracting Business rules from code



Jones
12-27-2007, 03:18 PM
Can someone help me abstract the business rule from the code bellow. I am not familia with progress codes and having some difficulties identifying the business ruless in this code. Please help me out. Wher can I find it. I need response ASAP. Thanks
:):):)


LoadFile Procedure
PROCEDURE LoadFile :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/

def var vString as char no-undo.
def var vCode as char no-undo.
def var vValue as char no-undo.
def var vSeqNo as int no-undo init 0.
def var vLog as logical no-undo.

pF-Message:Screen-Value = "Loading file " + pOrderFile.
vFileName = pInputDir + pOrderFile.
vLog = session:set-wait-state ("wait").
input stream t_input from value(vFileName) no-echo.
repeat:
import stream t_input unformatted vString.
vString = REPLACE(vString,"|":U,"-":U).
process events.

if entry(1, vString,"=") = vString then
do:
assign vCode = ""
vValue = vString.
end.
else
do:
assign vCode = entry(1, vString, "=")
vValue = trim(substring(vString, index(vString, '=')
+ 1)).
end.
create tEfile.
assign tEFile.SeqNo = vSeqNo + 1
tEfile.Tag = vCode
tEfile.TagValue = vValue.
vSeqNo = vSeqNo + 1.
end.
input stream t_input close.
input close.
vSeqNo = 0.
vLog = session:set-wait-state ("").

END PROCEDURE.

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

&ENDIF

&IF DEFINED(EXCLUDE-LoadNotes) = 0 &THEN

djr33
12-27-2007, 06:52 PM
What are you talking about? I don't see any human-style rules in there, like a TOS.

Jones
12-27-2007, 07:00 PM
Can you make sense off of the above codes. In a simple English can you explain to someone who does not know how to program what the above code is doing. That's what I am looking for. Thanks