Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > MIAMEX

MX_CSVDELIM

Scroll Prev Top Next More

xcall MIAMEX, MX_CSVDELIM, opcode, delim

MX_CSVDELIM (MIAMEX 181) allows the CSV delimiter to be set or retrieved.

Parameters

opcode  (Num)  [in]

0 (mxop_get) to retrieve, 1 to (mxop_set) set

delim (String, 1)  [in/out]

the delimiter retrieved (opcode 0) or to be set (opcode 1)

Comments

When set, the specified delimiter overrides the one normally used by the WRITECD and INPUT CSV statements.

The setting persists for the remainder of the session, or until changed explicitly by another call to MX_CSVDELIM.

To restore the default behavior, in which the delimiter is determined by the most prevalent of the four typical delimiter characters—comma, semicolon, colon, and tab—in the first line of the file, set the delim to "" (null).

Example

XCALL MIAMEX, MX_CSVDELIM, 0, OLD'DELIMITER$        ! retrieve original

XCALL MIAMEX, MX_CSVDELIM, 1, NEW'DELIMITER$        ! set new

OPEN #CH, FILE$, INPUT

 

XCALL MIAMEX, MX_CSVDELIM, 1, OLD'DELIMITER$        ! reset to original delimiter (won't affect this file)

 

INPUT CSV #CH, VAR1, VAR2, ...                      ! (uses NEW'DELIMITER$)