comp.lang.ada
 help / color / mirror / Atom feed
* text_io.open filename question
@ 1997-09-26  0:00 Oliver Hilgendorf
  1997-09-27  0:00 ` Tom Moran
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Hilgendorf @ 1997-09-26  0:00 UTC (permalink / raw)



I want to open several textfiles using text_io.open. The length of
each filename is only know at runtime. However if I define a string of
the maximum filename-length to hold the filename, all trailing blanks
are also passed to text_io.open and this results in name_error because
a file with trailing blanks does not exist.
So I have to pass a string that is defined with exactly the same
length as the actual filename.
How can I define a string object with variable length at runtime?

Oliver




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: text_io.open filename question
  1997-09-26  0:00 text_io.open filename question Oliver Hilgendorf
@ 1997-09-27  0:00 ` Tom Moran
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Moran @ 1997-09-27  0:00 UTC (permalink / raw)



Biggest_String:String(1 .. 200);
Last : Natural;
...
get (up to 200) characters into the first part of Biggest_String
set Last to the position of the last character, 
Just pass Biggest_String(1 .. Last) to the file open or whatever.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-09-27  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-26  0:00 text_io.open filename question Oliver Hilgendorf
1997-09-27  0:00 ` Tom Moran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox