-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$PACKAGE MX.Training | ||
SUBROUTINE MX.Logger(data, err) | ||
|
||
err = '' | ||
|
||
log_file = 'test_' : OCONV(DATE(), 'DG') : '.log' | ||
log_line = OCONV(TIME(), 'MTS') : '|' : data | ||
|
||
OPENSEQ '../bnk.log', log_file TO file_ptr THEN NULL | ||
|
||
WHITESEQ log_line APPEND TO file_ptr ELSE err = 'ERROR: Failed to write to ': log_file | ||
|
||
CLOSESEQ file_ptr | ||
|
||
RETURN | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
PROGRAM MX.TestProg | ||
|
||
$USING MX.Training | ||
|
||
PROMPT 'Enter a text to log: ' | ||
INPUT text | ||
CRT | ||
|
||
MX.Training.Logger(text, err) | ||
IF err NE '' THEN CRT err ELSE CRT 'OK' | ||
|
||
END |