Manual Reference Pages  - bundle (3m_strings)

NAME

bundle(3f) - [M_strings:ARRAY] return up to twenty strings of arbitrary length as an array (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
Author
License

SYNOPSIS

function bundle(str1,str2,...str20,len) result (vec)

    character(len=*),intent(in),optional   :: str1, str2 ... str20
    integer,intent(in),optional            :: len

DESCRIPTION

Given a list of up to twenty strings create a string array. The length of the variables with be the same as the maximum length of the input strings unless explicitly specified via LEN.

This is an alternative to the syntax

     [ CHARACTER(LEN=NN) :: str1, str2, ... ]

that by default additionally calculates the minimum length required to prevent truncation.

OPTIONS

str1,str2, ... str20
  input strings to combine into a vector
len length of returned array variables

EXAMPLES

Sample Program:

   program demo_bundle
   use M_strings, only: bundle
   implicit none
      print "(*(’""’,a,’""’:,’,’,1x))", bundle("one")
      print "(*(’""’,a,’""’:,’,’,1x))", bundle("one","two")
      print "(*(’""’,a,’""’:,’,’,1x))", bundle("one","two","three")
      print "(*(’""’,a,’""’:,’,’,1x))", bundle("one","two","three",&
              & "four","five","six","seven")
   end program demo_bundle

Expected output

   "one"
   "one", "two"
   "one  ", "two  ", "three"
   "one  ", "two  ", "three", "four ", "five ", "six  ", "seven"

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 bundle (3m_strings) March 31, 2024
Generated by manServer 1.08 from fea208a9-63f5-4c39-9688-dd65c0631352 using man macros.