Суббота, 30 ноября 2019, 21:22 +03:00 от Curly <gimmean...@gmail.com>:
I am iterating across a list of items, whose names are used to create files.The compiler insists that I initialise the PLAIN_TEXT_FILE object before I enter the loop.Does this mean that I have to create a dummy file pre-loop just to satisfy the compiler, or is there another way?
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/a3c9f611-80f4-47f0-bae5-8e4de53dbc47%40googlegroups.com.
ml_filename: STRING
ml_output_file: PLAIN_TEXT_FILE
make
local
division_list: ARRAY[STRING]
do
division_list := << "E0", "E1" >>
ml_filename := ""
-- create ml_output_file.make_create_read_write ("C:\Dummy_file.csv")
across division_list as division_entry
loop
ml_filename := "C:\Example\" + division_entry.item.out + "\real_file.csv"
create ml_output_file.make_open_write (ml_filename)
ml_output_file.close
end -- division_list loop
end -- make
Would you share the code with the issue, please?Alexander Kogtenkov
Суббота, 30 ноября 2019, 21:22 +03:00 от Curly <gimmean...@gmail.com>:
I am iterating across a list of items, whose names are used to create files.The compiler insists that I initialise the PLAIN_TEXT_FILE object before I enter the loop.Does this mean that I have to create a dummy file pre-loop just to satisfy the compiler, or is there another way?--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users+unsubscribe@googlegroups.com.
ml_output_file is an attribute. Since it is declared as attached, every creation procedure has to make sure it is non-void on exit of the procedure (i.e. on start of the object’s life).
The loop could be executed zero times. In that case, without the commented-out line, the attribute would be void.
-- BM
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/a3c9f611-80f4-47f0-bae5-8e4de53dbc47%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/f972a519-4ae1-4471-9f09-d46b87425311%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/a3c9f611-80f4-47f0-bae5-8e4de53dbc47%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel...@googlegroups.com.