![]() |
|
![]() |
//* // BlockDataLib - Routines to read and wrote text as block data. // // // This unit contains routines which handle writing, parsing and returning // text which has been stored as block data. Some routines are fairly low // level and simply return lines of text but other routines are very high // level and handle task such as completely copying text from a block data // field to a file and vice versa. //
procedure LoadControlFromBlock
(const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : array of char;
const Field : array of char;
var Success : boolean); overload; stdcall;
exports LoadControlFromBlock (const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : array of char;
const Field : array of char;
var Success : boolean) name 'BlockDataLib_LoadControlFromBlock';
//*
// LoadControlFromBlock - Load control with data from a block field.
//
//
// This procedure loads the data from a block field to a control on
// a dialog.
//
// CALLING SEQUENCE -
//
// LoadControlFromBlock (messageType, messageData, Relation,
// Field, Success)
//
// ENTRY -
//
// messageType : DisplayW.DisplayMessageType
// A parameter passed into the action proc, send into this routine.
//
// messageData : pointer
// A parameter passed into the action proc, send into this routine.
//
// Relation : array of char
// Relation of the block field.
//
// Field : array of char
// The name of the block data field.
//
// EXIT -
//
// Success : boolean
// True - No problems encountered, data loaded to control.
// False - Problem encountered, data not loaded.
//
procedure LoadControlFromBlock
(const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : string;
const Field : string;
var Success : boolean); overload; stdcall;
exports LoadControlFromBlock (const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : string;
const Field : string;
var Success : boolean) name 'BlockDataLib_STRLoadControlFromBlock';
//*
// STRLoadControlFromBlock - See documentation of LoadControlFromBlock.
//
procedure UnloadControlToBlock
(const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : array of char;
const Field : array of char;
var Success : boolean); overload; stdcall;
exports UnloadControlToBlock (const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : array of char;
const Field : array of char;
var Success : boolean) name 'BlockDataLib_UnloadControlToBlock';
//*
// UnloadControlToBlock - Transfer data from control to block field.
//
//
// This procedure transfers the current contents of a control to
// a block data field.
//
// CALLING SEQUENCE -
//
// UnloadControlToBlock (messageType, messageData, Relation,
// Field, Success)
//
// ENTRY -
//
// messageType : DisplayW.DisplayMessageType
// A parameter passed into the action proc, send into this routine.
//
// messageData : pointer
// A parameter passed into the action proc, send into this routine.
//
// Relation : array of char
// Relation of the block field.
//
// Field : array of char
// The name of the block data field.
//
// EXIT -
//
// Success : boolean
// True - No problems encountered, data loaded to block field.
// False - Problem encountered, data not loaded.
//
procedure UnloadControlToBlock
(const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : string;
const Field : string;
var Success : boolean); overload; stdcall;
exports UnloadControlToBlock (const messageType : DisplayW.DisplayMessageType;
const messageData : pointer;
const Relation : string;
const Field : string;
var Success : boolean) name 'BlockDataLib_STRUnloadControlToBlock';
//*
// STRUnloadControlToBlock - See documentation of UnloadControlFromBlock.
//
procedure CleanBlockField
(const Relation : array of char;
const Field : array of char;
var Success : boolean); overload; stdcall;
exports CleanBlockField (const Relation : array of char;
const Field : array of char;
var Success : boolean) name 'BlockDataLib_CleanBlockField';
//*
// CleanBlockField - Clean the contents of a block data field.
//
//
// This procedure completely clears the contents of a block
// data field. After this finishes any check of the field will
// show that it contains zero byte.
//
// CALLING SEQUENCE -
//
// CleanBlockField (Relation, Field)
//
// ENTRY -
//
// Relation : array of char
// Relation of the block field.
//
// Field : array of char
// The name of the block data field.
//
// EXIT -
//
// Success : BOOLEAN
// True - No problems encountered, field cleared.
// False - Problem encountered, field is not cleared.
//
procedure CleanBlockField
(const Relation : string;
const Field : string;
var Success : boolean); overload; stdcall;
exports CleanBlockField (const Relation : string;
const Field : string;
var Success : boolean) name 'BlockDataLib_STRCleanBlockField';
//*
// STRCleanBlockField - See documentation of CleanBlockField.
//
procedure BlockToFile
(const Relation : array of char;
const BlockField : array of char;
const FileName : array of char); overload; stdcall;
exports BlockToFile (const Relation : array of char;
const BlockField : array of char;
const FileName : array of char) name 'BlockDataLib_BlockToFile';
//*
// BlockToFile - Copy data from block data field to a file.
//
//
// This procedure copies block data from the block data field
// into a file. This is useful for doing reports and editing
// the data outside of the field.
//
// CALLING SEQUENCE -
//
// BlockToFile (Relation, BlockField, FileName)
//
// ENTRY -
//
// Relation : array of char
// Relation of the block field.
//
// BlockField : array of char
// The name of the block data field.
//
// FileName : array of char
// The name of the file to put the data in.
//
procedure BlockToFile
(const Relation : string;
const BlockField : string;
const FileName : string); overload; stdcall;
exports BlockToFile (const Relation : string;
const BlockField : string;
const FileName : string) name 'BlockDataLib_STRBlockToFile';
//*
// STRBlockToFile - See documentation of BlockToFile.
//
procedure FileToBlock
(const FileName : array of char;
const Relation : array of char;
const BlockField : array of char); overload; stdcall;
exports FileToBlock (const FileName : array of char;
const Relation : array of char;
const BlockField : array of char) name 'BlockDataLib_FileToBlock';
//*
// FileToBlock - Copy data from a file to a block data field.
//
//
// This procedure copies block data from a file into a block
// data field.
//
// CALLING SEQUENCE -
//
// FileToBlock (FileName, Relation, BlockField)
//
// ENTRY -
//
// FileName : ARRAY OF CHAR
// The name of the file containing the data.
//
// Relation : ARRAY OF CHAR
// Relation of the block field.
//
// BlockField : ARRAY OF CHAR
// The name of the block data field.
//
procedure FileToBlock
(const FileName : string;
const Relation : string;
const BlockField : string); overload; stdcall;
exports FileToBlock (const FileName : string;
const Relation : string;
const BlockField : string) name 'BlockDataLib_STRFileToBlock';
//*
// STRFileToBlock - See documentation of FileToBlock.
//
function FileLargerThan
(const FileName : array of char;
const CheckSize : Files.FilePosition) : boolean; overload; stdcall;
exports FileLargerThan (const FileName : array of char;
const CheckSize : Files.FilePosition) name 'BlockDataLib_FileLargerThan';
//*
// FileLargerThan - Test if a file is larger than the given size.
//
//
// This procedure checks a file size to see if it is larger than
// the given CheckSize. A boolean value is returned of the
// result.
//
// CALLING SEQUENCE -
//
// FileLargerThan (FileName, CheckSize)
//
// ENTRY -
//
// FileName : ARRAY OF CHAR
// The name of the file containing the data.
//
// CheckSize : Files.FilePosition
// The size to check against the file.
//
// EXIT -
//
// FileLargerThan : BOOLEAN
// True - The current size of the file is larger then the CheckSize.
// False - The current size of the file is less than or equal to the
// CheckSize.
//
function FileLargerThan
(const FileName : string;
const CheckSize : Files.FilePosition) : boolean; overload; stdcall;
exports FileLargerThan (const FileName : string;
const CheckSize : Files.FilePosition) name 'BlockDataLib_STRFileLargerThan';
//*
// STRFileLargerThan - See documentation of FileLargerThan.
//
procedure CountFileLines
(const FileName : array of char;
const maxLength : cardinal;
var numLines : cardinal); overload; stdcall;
exports CountFileLines (const FileName : array of char;
const maxLength : cardinal;
var numLines : cardinal) name 'BlockDataLib_CountFileLines';
//*
// CountFileLines - Count how many lines are in this file.
//
//
// This procedure counts the number of lines of data contained
// within this file. Note that there is a max line length
// value used during the counting so if a current line in the
// file actually contains more data than this max value the
// line will be counted as two lines.
//
// CALLING SEQUENCE -
//
// CountFileLines (FileName, maxLength, numLines)
//
// ENTRY -
//
// FileName : ARRAY OF CHAR
// The name of the file containing the data.
//
// maxLength : CARDINAL
// The max length to count as a single line.
//
// EXIT -
//
// NumLines : CARDINAL
// The number of lines that this file will produce when the data
// is pulled out given that the maxLength value is used at that
// time also.
//
procedure CountFileLines
(const FileName : string;
const maxLength : cardinal;
var numLines : cardinal); overload; stdcall;
exports CountFileLines (const FileName : string;
const maxLength : cardinal;
var numLines : cardinal) name 'BlockDataLib_STRCountFileLines';
//*
// STRCountFileLines - See documentation of CountFileLines.
//
procedure BlockToString
(const Relation : array of char;
const Field : array of char;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char); overload; stdcall;
exports BlockToString (const Relation : array of char;
const Field : array of char;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char) name 'BlockDataLib_BlockToString';
//*
// BlockToString - Get a line of data from a block data field.
//
//
// This procedure gets a line of data from the block field. It
// uses the LineNumber parameter to calculate which piece of
// data is being requested.
//
// CALLING SEQUENCE -
//
// BlockToString (Relation, Field, LineNumber, LineMax, line)
//
// ENTRY -
//
// Relation : ARRAY OF CHAR
// The name of the relation holding the block field.
//
// Field : ARRAY OF CHAR
// The name of the block data field.
//
// LineNumber : CARDINAL
// The sequential number of the line to retrieve. (i.e. 42 would
// request that the forty second line of data be return.
//
// LineMax : CARDINAL
// A max number of characters to use when calculating lines of data.
//
// EXIT -
//
// line : ARRAY OF CHAR
// The buffer used to contain the line of data on return.
//
procedure BlockToString
(const Relation : string;
const Field : string;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char); overload; stdcall;
exports BlockToString (const Relation : string;
const Field : string;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char) name 'BlockDataLib_STRBlockToString';
//*
// STRBlockToString - See documentation of BlockToString.
//
procedure FileToString
(const FileName : array of char;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char); overload; stdcall;
exports FileToString (const FileName : array of char;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char) name 'BlockDataLib_FileToString';
//*
// FileToString - Get a line of data from a file.
//
//
// This procedure gets a line of data from a file. It
// uses the LineNumber parameter to calculate which piece of
// data is being requested.
//
// CALLING SEQUENCE -
//
// FileToString (FileName, LineNumber, LineMax, line)
//
// ENTRY -
//
// FileName : ARRAY OF CHAR
// The name of the file containing the data.
//
// LineNumber : CARDINAL
// The sequential number of the line to retrieve. (i.e. 42 would
// request that the forty second line of data be return.
//
// LineMax : CARDINAL
// A max number of characters to use when calculating lines of data.
//
// EXIT -
//
// line : ARRAY OF CHAR
// The buffer used to contain the line of data on return.
//
procedure FileToString
(const FileName : string;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char); overload; stdcall;
exports FileToString (const FileName : string;
const LineNumber : cardinal;
const LineMax : cardinal;
var line : array of char) name 'BlockDataLib_STRFileToString';
//*
// STRFileToString - See documentation of FileToString.
//
function BlockLargerThan
(const Relation : array of char;
const Field : array of char;
const CheckSize : ModSys.INT32) : boolean; overload; stdcall;
exports BlockLargerThan (const Relation : array of char;
const Field : array of char;
const CheckSize : ModSys.INT32) name 'BlockDataLib_BlockLargerThan';
//*
// BlockLargerThan - Test if a block field is larger than the given size.
//
//
// This procedure checks a block field size to see if it is larger than
// the given CheckSize. A boolean value is returned of the result.
//
// CALLING SEQUENCE -
//
// BlockLargerThan (Relation, Field, CheckSize)
//
// ENTRY -
//
// Relation : ARRAY OF CHAR
// The name of the relation containing the data.
//
// Field : ARRAY OF CHAR
// The name of the field containing the data.
//
// CheckSize : Files.FilePosition
// The size to check against the file.
//
// EXIT -
//
// BlockLargerThan : BOOLEAN
// True - The current size of the file is larger then the CheckSize.
// False - The current size of the file is less than or equal to the
// CheckSize.
//
function BlockLargerThan
(const Relation : string;
const Field : string;
const CheckSize : ModSys.INT32) : boolean; overload; stdcall;
exports BlockLargerThan (const Relation : string;
const Field : string;
const CheckSize : ModSys.INT32) name 'BlockDataLib_STRBlockLargerThan';
//*
// STRBlockLargerThan - See documentation of BlockLargerThan.
//
procedure CountBlockLines
(const Relation : array of char;
const Field : array of char;
const maxLength : cardinal;
var numLines : cardinal); overload; stdcall;
exports CountBlockLines (const Relation : array of char;
const Field : array of char;
const maxLength : cardinal;
var numLines : cardinal) name 'BlockDataLib_CountBlockLines';
//*
// CountBlockLines - Count how many lines are in a block field.
//
//
// This procedure counts the number of lines of data contained
// within a block field. Note that there is a max line length
// value used during the counting so if a current line in the
// file actually contains more data than this max value the
// line will be counted as two lines.
//
// CALLING SEQUENCE -
//
// CountBlockLines (Relation, Field, maxLength, numLines)
//
// ENTRY -
//
// Relation : ARRAY OF CHAR
// The name of the relation containing the data.
//
// Field : ARRAY OF CHAR
// The name of the field containing the data.
//
// maxLength : CARDINAL
// The max length to count as a single line.
//
// EXIT -
//
// NumLines : CARDINAL
// The number of lines that this file will produce when the data
// is pulled out given that the maxLength value is used at that
// time also.
//
procedure CountBlockLines
(const Relation : string;
const Field : string;
const maxLength : cardinal;
var numLines : cardinal); overload; stdcall;
exports CountBlockLines (const Relation : string;
const Field : string;
const maxLength : cardinal;
var numLines : cardinal) name 'BlockDataLib_STRCountBlockLines';
//*
// STRCountBlockLines - See documentation of CountBlockLines.
//
procedure ClearBlockFile
(const FileName : array of char); overload; stdcall;
exports ClearBlockFile (const FileName : array of char) name 'BlockDataLib_ClearBlockFile';
//*
// ClearBlockFile - Clear the contents of a file.
//
//
// This procedure completely clears the contents of a file.
// After this finishes any check of the file will show that
// it contains zero byte.
//
// CALLING SEQUENCE -
//
// ClearBlockFile (FileName)
//
// ENTRY -
//
// FileName : ARRAY OF CHAR
// The name of the file to clear.
//
procedure ClearBlockFile
(const FileName : string); overload; stdcall;
exports ClearBlockFile (const FileName : string) name 'BlockDataLib_STRClearBlockFile';
//*
// STRClearBlockFile - See documentation of ClearBlockFile.
//
procedure CalculateSlice
(const Buffer : array of char;
const startOffset : cardinal;
const maxLength : cardinal;
var numBytes : cardinal;
var WasteBytes : cardinal); overload; stdcall;
exports CalculateSlice (const Buffer : array of char;
const startOffset : cardinal;
const maxLength : cardinal;
var numBytes : cardinal;
var WasteBytes : cardinal) name 'BlockDataLib_CalculateSlice';
//*
// CalculateSlice - Given startOffset what is the size of the next line.
//
//
// This procedure calculates the next slice (line) of data given the
// starting position of startOffset and using maxLength. The numBytes
// param returns how many bytes of good data will be available and
// the WasteBytes param returns how many bad bytes. The bad bytes come
// from things such as trying to use an offset that begins at the
// start of a CR LF pair. In that case WasteBytes comes back as two.
//
// CALLING SEQUENCE -
//
// CalculateSlice (Buffer, startOffset, maxLength, numBytes,
// WasteBytes)
//
// ENTRY -
//
// Buffer : ARRAY OF CHAR
// The buffer of data to check.
//
// startOffset : CARDINAL
// The offset from the beginning of the buffer to start the
// calculation.
//
// maxLength : CARDINAL
// The max length for a line of data.
//
// EXIT -
//
// numBytes : CARDINAL
// The number of bytes of data that will be a valid line.
//
// WasteBytes : CARDINAL
// The number of bytes that will be ignore such as using
// an offset that starts in the middle of a CR LF pair. In
// that case the LF would be a waste byte so a value of 1 would
// be returned.
//
procedure CalculateSlice
(const Buffer : string;
const startOffset : cardinal;
const maxLength : cardinal;
var numBytes : cardinal;
var WasteBytes : cardinal); overload; stdcall;
exports CalculateSlice (const Buffer : string;
const startOffset : cardinal;
const maxLength : cardinal;
var numBytes : cardinal;
var WasteBytes : cardinal) name 'BlockDataLib_STRCalculateSlice';
//*
// STRCalculateSlice - See documentation of CalculateSlice.
//
Send mail to
warren.merrill@inl.gov
with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance