Adxifs

adxifs is a character string variable of length 1 that contains the field separator used when reading or writing sequential files by the instructions Rdseq and Wrseq.

Every element in a list given as an argument in Rdseq or Wrseq is separated by the field separator, and there is a line separator defined by [[adxirs] at the end of the element list.

Note that this is a global value for all the files opened. Using the Iomode instruction gives you the control on every file opened, which is preferable.

Syntax

adxifsIomode adxifs EXPRESSION Using [ABBREVIATION]

Examples

# On a Unix server, read the /etc/passwd file to find out the user characteristics for a given user id# This supposes that the user connected has the access rights !# The structure of a line is the following:# login:x:user_id:group_id:user_description:home_directory:shellSubprog GET_UNIX_USER(USER_ID, USER_DESCRIPTION, HOME_DIRECTORY)Value Integer USER_IDVariable Char USER_DESCRIPTION(), HOME_DIRECTORY()Local Char LOGIN(20),DUMMY(20),UID(10),GID(10),DESCRIPTION(100),HOMEDIR(100),SHELL(100)Openi "/etc/passwd" using [PWD]adxifs = ":"adxirs = chr$(10)RepeatRdseq LOGIN,DUMMY,UID,GID,DESCRIPTION,HOMEDIR,SHELL Using [PWD]Until val(GID)=USER_ID or fstat=0Openi using [PWD]If val(GID)=USER_IDUSER_DESCRIPTION=DESCRIPTIONHOME_DIRECTORY=HOMEDIRElseRaz USER_DESCRIPTION, HOME_DIRECTORYEndifEnd# Write on a sequential file values separated by commasOpeno MYFILE Using [MYF]Iomode adxifs ',' Using [MYF]Iomode adxifs chr$(13)+chr$(10) Using [MYF] : # Carriage return Line feedFor I=1 to dim(VALUES)Wrseq I,VALUES(I),sum(VALUES(1..I)) Using [MYF]Next IOpeno Using [MYF]

Comments

If the field separator is the space character, Rdseq considers several spaces in a row as a single separator.

See also

adxirs, adxium, Rdseq, Wrseq, Openi, Openo, Openio.