bundle(3f) - [M_strings:ARRAY] return up to twenty strings of arbitrary length as an array (LICENSE:PD)
Synopsis
Description
Options
Examples
Author
License
function bundle(str1,str2,...str20,len) result (vec)
character(len=*),intent(in),optional :: str1, str2 ... str20 integer,intent(in),optional :: len
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.
str1,str2, ... str20 input strings to combine into a vector len length of returned array variables
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_bundleExpected output
"one" "one", "two" "one ", "two ", "three" "one ", "two ", "three", "four ", "five ", "six ", "seven"
John S. Urban
Public Domain
Nemo Release 3.1 | bundle (3m_strings) | March 31, 2024 |