Skip to content

MFGS Misc

MFGSMisc Public interface

Description

Describes methods and properties available on the static instance object MFGS.Misc

Diagram

flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph VGWWCoreIEx
VGWWCoreIEx.IExMFGSMisc[[IExMFGSMisc]]
class VGWWCoreIEx.IExMFGSMisc interfaceStyle;
end

Members

Methods

Public methods

ReturnsName
string``[]ASCIIArray(string text, string delimiter, int offset)
Parses a string into an array of strings.
stringASCIIField(string text, int position, string delimiter)
Get subset of the text based on the position and delimiter.
objectCreate(MFGSCreateType type, object``[] args)
Creates an object based on the parameters passed in.
stringLPad(string text, int length, string padChar)
Returns a new string of a specified length in which the beginning of the text string is padded with spaces or the specified padChar character.
stringRPad(string text, int length, string padChar)
Returns a new string of a specified length in which the end of the text string is padded with spaces or the specified padChar character.
objectSwitch(object value, object``[] args)
Compares the value to the odd-numbered parameters and when equal will return the subsequent even-numbered parameter value.
IMFGSListTextWrap(string text, int width, int lines)
Breaks a string into separate lines.

Details

Summary

Describes methods and properties available on the static instance object MFGS.Misc

Methods

ASCIIArray

public string ASCIIArray(string text, string delimiter, int offset)
Arguments
TypeNameDescription
stringtextThe string to parse.
stringdelimiterThe delimiter between each string to be added to the array.
intoffsetThe starting index of values parsed into the array.
Summary

Parses a string into an array of strings.

Remarks

As the text is parsed the delimiter is removed and will not be include in the string array values. Double-quotes are used to signify a section of text where the delimiter string should be ignored. The array returned is 0-based and the length will be equal to the number of parsed values found + offset . If offset is greater than zero the value of elements 0 thru offset will be an empty string.

Returns

An array of strings

ASCIIField

public string ASCIIField(string text, int position, string delimiter)
Arguments
TypeNameDescription
stringtextThe string to search.
intpositionThe 1-based position of the text subset.
stringdelimiterThe delimiter used to parse the text into subsets.
Summary

Get subset of the text based on the position and delimiter.

Returns

A string value, or an empty string if text is null or empty, or an empty string if position is zero or less.

Create

public object Create(MFGSCreateType type, object[] args)
Arguments
TypeNameDescription
MFGSCreateTypetypeThe type of object to create.
object``[]argsOptional parameters used when creating the object
Summary

Creates an object based on the parameters passed in.

Returns

Switch

public object Switch(object value, object[] args)
Arguments
TypeNameDescription
objectvalueThe value to be compared.
object``[]argsThe parameters passed to the method where the relative position of each determines its use.
Summary

Compares the value to the odd-numbered parameters and when equal will return the subsequent even-numbered parameter value.

Remarks

Parameters should be passed in as sets of two, with the first one being the one to compare against value, and the second one being the value returned. The last parameter passed in is the default value to be returned if no match is found. If no default value parameter is passed in, the method will return null (or empty string in VBA) is no match is found. If no parameters are passed in, the method will return null (or empty string in VBA). This method uses the VBA equals (=) operator for comparison which is affected by the ‘Option Compare’ declaration.

Returns

A value based on the parameters passed in.

TextWrap

public IMFGSList TextWrap(string text, int width, int lines)
Arguments
TypeNameDescription
stringtextThe string to line-break.
intwidthThe max number of characters per line.
intlinesThe max number of lines.
Summary

Breaks a string into separate lines.

Remarks

This method will first line-break text on any carriage return (“\r”) or line feed (“\n”) characters found. Each line is then further broken apart on the last space (” ”) character found without exceeding the width . If a space character cannot be found the line is broken at width . Any leading or trailing whitespace characters of each line will be removed. If text contains only whitespace, or width is zero, or lines is zero, then an empty IMFGSList object will be returned. If width is less than zero, the returned IMFGSList object will contain a single line containing text . If lines is less than zero, then there is no limit on the max number of lines. If lines is greater than zero, and the number of lines created by breaking the text does not exceed this value, an empty string will be inserted into the the returned IMFGSList object until Count equals this value.

Returns

An IMFGSList object containing zero or more string values depending on the parameters passed.

LPad

public string LPad(string text, int length, string padChar)
Arguments
TypeNameDescription
stringtextThe string to be padded.
intlengthThe minimum length of the returned string.
stringpadCharThe character used to pad the string.
Summary

Returns a new string of a specified length in which the beginning of the text string is padded with spaces or the specified padChar character.

Returns

A new string that is equivalent to text , but right-aligned and padded on the left with as many characters as needed to reach length . However, if length is less than or equal to the length of text , the method returns text . If padChar is ommited or an empty string, a space will be used as the padding chracter. If padChar contains more than one character, only the first character will be used to pad the string.

RPad

public string RPad(string text, int length, string padChar)
Arguments
TypeNameDescription
stringtextThe string to be padded.
intlengthThe minimum length of the returned string.
stringpadCharThe character used to pad the string.
Summary

Returns a new string of a specified length in which the end of the text string is padded with spaces or the specified padChar character.

Returns

A new string that is equivalent to text , but left-aligned and padded on the right with as many characters as needed to reach length . However, if length is less than or equal to the length of text , the method returns text . If padChar is ommited or an empty string, a space will be used as the padding chracter. If padChar contains more than one character, only the first character will be used to pad the string.

Generated with ModularDoc