libsim  Versione 7.2.1

◆ line_split_new()

type(line_split) function, public char_utilities::line_split_new ( character(len=*), intent(in)  line,
integer, intent(in), optional  ncols 
)

Constructor for the line_split class.

It creates a new object allowing to split a line of text into multiple lines of predefined length at blank spaces. If a line can't be splitted because a word is longer than the line, it is truncated.

Parametri
[in]lineline to be splitted
[in]ncolsmaximum number of columns on every line, if not provided a suitable default is used

Definizione alla linea 995 del file char_utilities.F90.

996  end if
997  end do
998 
999 deallocate(igoodchar)
1000 
1001 else
1002 
1003  charrr=in
1004 
1005 end if
1006 
1007 
1008 
1009 if (present(badchar)) then
1010 
1011 allocate(ibadchar(len(badchar)))
1012 
1013  do i =1, len(badchar)
1014  ibadchar=ichar(badchar(i:i))
1015  end do
1016 
1017  nchar=0
1018  do i=1,len(charrr)
1019  ia = ichar(charrr(i:i))
1020  if (.not. any(ia == ibadchar))then
1021  nchar=nchar+1
1022  charr(nchar:nchar)=achar(ia)
1023  end if
1024  end do
1025 
1026 deallocate(ibadchar)
1027 
1028 else
1029 
1030  charr=charrr
1031 
1032 end if
1033 
1034 
1035 if (.not. present(goodchar) .and. .not. present(badchar)) then
1036 
1037  nchar=0
1038  do i=1,len(charr)
1039  ia = ichar(charr(i:i))
1040  if ((ia >= 65 .and. ia <= 90) .or. &
1041  (ia >= 97 .and. ia <= 122))then
1042  nchar=nchar+1
1043  char(nchar:nchar)=achar(ia)
1044  end if
1045  end do
1046 
1047 else
1048 
1049  char=charr
1050 
1051 end if
1052 
1053 
1054 END FUNCTION wash_char
1055 
1056 
1057 ! derived by http://sourceforge.net/projects/flibs
1058 !
1059 ! globmatch.f90 --
1060 ! Match strings according to (simplified) glob patterns
1061 !
1062 ! The pattern matching is limited to literals, * and ?
1063 ! (character classes are not supported). A backslash escapes
1064 ! any character.
1065 !
1066 ! $Id: globmatch.f90,v 1.5 2006/03/26 19:03:53 arjenmarkus Exp $
1067 !!$Copyright (c) 2008, Arjen Markus
1068 !!$
1069 !!$All rights reserved.

Generated with Doxygen.