Standard Library
COBOL Functions
These routines are designed to be called from any language. They have been
thoroughly tested with the MicroFocus
NetExpress COBOL compiler.
Many of these routines pass character strings in the "
01 PASSED-BUFFER. 03 STRING-LENGTH PIC S9999 USAGE COMP-5 VALUE 14. 03 STRING-CHARS PIC X(14) VALUE 'This is a test'.Many of these functions return a value as well as operating on the arguments. The value of the function will be in RETURN-CODE (if called with COBOL), which should be set to a 16-bit integer (short). Note that all arguments are passed by reference since these functions are designed to be used with COBOL CALL-CONVENTION 8.
Key = 1: | Right justify String | |
Key = 2: | Left justify String | |
Key = 3: | Center the String | |
Key = 4: | Left justify String removing all spaces | |
Key = 5: | Right justify String with zero fill; i.e., convert to numeric |
InOption = 1: | Convert all upper case letters to lower case | |
InOption = 2: | Convert all upper case letters except the first one after a period to lower case | |
InOption = 3: | Convert all upper case letters except the one immediately following a blank to lower case | |
InOption = 4: | Convert all upper case letters except the one immediately following a blank or a lower case letter to lower case | |
InOption = 5: | Convert all upper case letters except the one immediately following a non-upper case letter to lower case unless the word begins with "MC" | |
InOption = 6: | Convert all upper case letters except the one immediately following a non-upper-case letter and a non-number | |
InOption = 7: | Convert all upper case letters except the one immediately following a non-upper-case letter unless the next two characters are "ST", "ND", "RD", OR "TH" |
Filters: | Array of file filters (extensions). The format is a series of null-terminated strings terminated with a second null after the last string. | |
FileName: | Buffer for file name returned. Note that if a path and file are specified upon entry, the dialog box will be initialized with them. Both the specified and returned pathname will be null terminated. The buffer size is specified in the option block below. | |
WinTitle: | Dialog box window title as a null-terminated string. | |
Option: | as follows: | |
03 PARENT-WINDOW-HANDLE PIC S9(9) USAGE COMP-5. 03 PARENT-INSTANCE-HANDLE PIC S9(9) USAGE COMP-5. 03 FNAMES-MAX-BUFFER-SIZE PIC S9999 USAGE COMP-5. 88 POSITIVE IS OPEN (INPUT) 88 NEGATIVE IS SAVE AS (OUTPUT) 03 DIALOG-BOX-FUNCTION-RESULT PIC S9999 USAGE COMP-5. 88 SUCCESS VALUE 1. 03 FILE-NAME-WITHOUT-PATH PIC X(14). |
MergeRecord: | ||
Pattern: | short array; count followed by lengths | |
ResultFields: | Concatenated fields |
CALL-CONVENTION 8 IS VCPP. 01 ORIGINAL-RECORD. 03 OR-LENGTH PIC S9999 USAGE COMP-5 VALUE 80. 03 OR-RECORD PIC X(80). 01 MERGE-PATTERN. 03 MP-COUNT PIC S9999 USAGE COMP-5 VALUE 3. 03 MP-NUMBER PIC S9999 USAGE COMP-5 VALUE 6. 03 MP-NAME PIC S9999 USAGE COMP-5 VALUE 30. 03 MP-DESCRIPTION PIC S9999 USAGE COMP-5 VALUE 50. 01 PARSED-RECORD. 03 PR-NUMBER PIC X(6). 03 PR-NAME PIC X(30). 03 PR-DESCRIPTION PIC X(50). CALL VCPP 'PMRG$O' USING ORIGINAL-RECORD, MERGE-PATTERN, PARSED-RECORD.
Key = | 1: | CSDisCreate::Open(Buffer) | ||
Key = | 2: | CSDisCreate::Close() | ||
Key = | 3: | CSDisCreate::StartFile(Buffer) | ||
Key = | 4: | CSDisCreate::EndFile() | ||
Key = | 5: | CSDisCreate::StartPage(Buffer) | ||
Key = | 6: | CSDisCreate::EndPage() | ||
Key = | 7: | CSDisCreate::StartLine(Buffer) | ||
Key = | 8: | CSDisCreate::EndLine() | ||
Key = | 9: | CSDisCreate::Packet(Buffer) | ||
Key = | 10: | CSDisCreate::CompleteLine(Buffer); |
Key = 0: | Load the name of the table file from Buffer, which is a PIC X(n) and is space-terminated. | |
Key = 1: | Set the length of each record from
Buffer, which is a PIC S9999 USAGE | |
Key = 2: | Set the address of the memory buffer to be used for all file operations from Buffer. | |
Key = 3: | Load the contents of the file into the memory buffer and close the file. | |
Key = 4: | Store the contents of the memory buffer into the file and close it. | |
Key = 5: | Read the contents of the file into the memory buffer and leave the file open for use by Key = 6. | |
Key = 6: | Write the contents of the memory buffer into the file opened by Key = 5 and close it. |
Key = | 1: | CTransferData::Open(Key, Buffer, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite) | ||
Key = | 2: | CTransferData::Write(Buffer) | ||
Key = | 3: | CTransferData::Close() | ||
Key = | 4: | CTransferData::Open(Key, Buffer, CFile::modeRead | CFile::shareDenyNone) | ||
Key = | 5: | CTransferData::Read(Buffer) | ||
Key = | 6: | CTransferData::Close() |
[ Stand-alone Programs
| Standard Library
| Conversion Functions
| Utility Functions
]
[ Windows NT Library
| COBOL Library
| COBOL Interface
| Command Prompt Abbreviations
| Purchase Instructions
]
[ Home
| Areas of Expertise
| "We Do Windows"
| Clients and Projects
| Software Samples
| Package Software Available
]
[ Contact Information
| Business Software Philosophy
| Church Software Philosophy
]
All contents of this web site are Copyright © Titus Information Systems,
Inc., Phoenix, Arizona, U.S.A.