@@ -97,6 +97,7 @@ module stdlib_stringlist_type
97
97
interface stringlist_type
98
98
module procedure new_stringlist
99
99
module procedure new_stringlist_carray
100
+ module procedure new_stringlist_sarray
100
101
end interface
101
102
102
103
! > Version: experimental
@@ -150,9 +151,6 @@ module stdlib_stringlist_type
150
151
! > Returns a new instance of type stringlist
151
152
pure function new_stringlist ()
152
153
type (stringlist_type) :: new_stringlist
153
- type (string_type), dimension (0 ) :: sarray
154
-
155
- new_stringlist = stringlist_type( sarray )
156
154
157
155
end function new_stringlist
158
156
@@ -172,6 +170,17 @@ pure function new_stringlist_carray( array )
172
170
173
171
end function new_stringlist_carray
174
172
173
+ ! > Constructor to convert stringarray to stringlist
174
+ ! > Returns a new instance of type stringlist
175
+ pure function new_stringlist_sarray ( array )
176
+ type (string_type), dimension (:), intent (in ) :: array
177
+ type (stringlist_type) :: new_stringlist_sarray
178
+
179
+ new_stringlist_sarray = stringlist_type()
180
+ new_stringlist_sarray% stringarray = array
181
+
182
+ end function new_stringlist_sarray
183
+
175
184
! constructor for stringlist_index_type:
176
185
177
186
! > Returns an instance of type 'stringlist_index_type' representing forward index 'idx'
0 commit comments