Navigation:  Reference > Functions >

StringPortion()

Print this Topic Previous pageReturn to chapter overviewNext page

 

MID(1,2,3)

 

PURPOSE

This function will return a portion of a specified A type field.

 

PARTS

1 f/c/eRequired - The value to be parsed.

 

2 f/c/eThe starting character position.  The first character of an A type field is position 1.  The default value is 1.

 

3 f/c/eRequired - The number of characters to return.  If the value given would go beyond the end of the original field, only those characters up to the end of the field will be passed.

 

RETURN TYPE - A

If the receiving field is too short, the remaining characters will be truncated.

EXAMPLE

define x,y type a size 20

x = 'ABCDEFG'

y = MID(x,2,2)

// y = 'BC'

 

y = MID(x,6,10)

// y = 'FG'

 

SEE ALSO

MID_REC()

 

Other Information

EQUALS PORTION OF

This is a TAS Professional 3.0 command here for compatibility.  The preferred method is to use the

=MID() function.

EQU_MID recv_field FLD parse_fld START start_val NCHR num_chrs MEM_AREA memory_area#

recv_field - fn/v - Required - The field that is going to receive the portion of the parse_fld.

parse_fld - fn/v - Required - The field that you want a part of.

start_val - f/c/e - Required - The starting character in the parse_fld.  The first character in the field is at position 1.

num_chrs - f/c/e - Required - The number of characters to get from the parse_fld.

mem_area# - f/c/e - Optional - If you are actually getting the characters from a memory area

then this is the number (from 1-4).

NOTE:  Even if you want to use a memory area you must still specify a parse_fld, although it will be ignored during execution of the

command.

COMMENTS

This is the equivalent of the TAS Professional 3.0 command Equals Portion Of.

 


Page url: http://www.cassoftware.com/tas/manual/stringportion().htm