APPEND_STRING@

Platform

x64, Win32

Purpose

To add a string to the end of a line.

Syntax

SUBROUTINE APPEND_STRING@(LINE,ADDITION)
CHARACTER (LEN=*) LINE,ADDITION

Description

This routine adds the string ADDITION to the end of string LINE after removing trailing spaces from LINE. This can be used to build up complex strings without the need to do many substring calculations.

Example

PROGRAM SONG
CHARACTER (LEN=80)::LINE
CHARACTER (LEN=20)::SAYINT
INTEGER::NO_GREEN_BOTTLES
LINE='THERE ARE'
READ *,NO_GREEN_BOTTLES
IF(NO_GREEN_BOTTLES == 0)THEN
  CALL APPEND_STRING@(LINE,' NO')
ELSE
  CALL APPEND_STRING@(LINE,' '//SAYINT(NO_GREEN_BOTTLES))
ENDIF
CALL APPEND_STRING@(LINE,' STANDING ON A WALL')
CALL SOU@(LINE)
END PROGRAM SONG

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited