PLplot  5.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
strutil.f
Go to the documentation of this file.
1 ! $Id: strutil.f 11680 2011-03-27 17:57:51Z airwin $
2 !
3 ! Copyright (C) 2004 Alan W. Irwin
4 !
5 ! This file is part of PLplot.
6 !
7 ! PLplot is free software; you can redistribute it and/or modify
8 ! it under the terms of the GNU Library General Public License as published
9 ! by the Free Software Foundation; either version 2 of the License, or
10 ! (at your option) any later version.
11 !
12 ! PLplot is distributed in the hope that it will be useful,
13 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ! GNU Library General Public License for more details.
16 !
17 ! You should have received a copy of the GNU Library General Public License
18 ! along with PLplot; if not, write to the Free Software
19 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  subroutine plstrf2c(string1, string2, maxlen)
22 
23  integer*4 maxlen
24  integer islen
25  character*(*) string1, string2
26 
27  integer*4 limit
28 
29  limit = min0(islen(string1),maxlen-1)
30  do 100 i = 1,limit
31  string2(i:i) = string1(i:i)
32  100 continue
33  string2(limit+1:limit+1) = char(0)
34 
35  return
36  end
37 
38 
39  subroutine plstrc2f(string1, string2)
40 
41  character*(*) string1, string2
42 
43  integer*4 limit
44  character*300 stringbuf
45 
46  limit = 1
47  10 if (ichar(string1(limit:limit)) .eq. 0) goto 20
48  stringbuf(limit:limit) = string1(limit:limit)
49  limit = limit + 1
50  goto 10
51 
52  20 if(limit.gt.1) then
53  string2 = stringbuf(1:limit-1)
54  else
55  string2 = ''
56  endif
57 
58  return
59  end
60 
61 
62  integer function islen(string)
63  character*(*) string
64  integer i
65 
66  do 100 i = len(string),1,-1
67  if (string(i:i) .ne. ' ') then
68  islen = i
69  return
70  endif
71  100 continue
72 
73  if(len(string).eq.0) then
74 C If string is length 0, return length 0
75  islen = 0
76  else
77 C If string is blank, return length of 1
78  islen = 1
79  endif
80  return
81  end
subroutine plstrc2f(string1, string2)
Definition: strutil.f:39
integer function islen(string)
Definition: strutil.f:62
if write to the Free Software C Franklin Fifth MA USA integer maxlen string3 character *maxlen string6 character *maxlen string9 integer string1
Definition: sfstubs.h:29
if write to the Free Software C Franklin Fifth MA USA integer maxlen string2
Definition: sfstubs.h:24
subroutine plstrf2c(string1, string2, maxlen)
Definition: strutil.f:21
void string(PLINT n, const PLFLT *x, const PLFLT *y, const char *string)
Definition: plstream.cc:2107