Thread overview
Why foreach do not print value during every single Insert request in SQL?
Jan 15, 2015
Suliman
Jan 15, 2015
Rikki Cattermole
Jan 15, 2015
Vladimir Panteleev
January 15, 2015
		void IMGsInsert(string [] fullimgurl)
		{
			foreach (url; fullimgurl)
			{
				string sqlinsert = (sqlrequest)
				writeln(sqlinsert);
				write("|");
				auto rs = stmt.executeUpdate(sqlinsert);
			}

		}

I expect nice progress indicator "|" which move forward after every Insert request.
Like:
||||
and so on.

The problem that App wait some time and only in prints a heap of "|". Why?
January 15, 2015
On 16/01/2015 1:05 a.m., Suliman wrote:
>          void IMGsInsert(string [] fullimgurl)
>          {
>              foreach (url; fullimgurl)
>              {
>                  string sqlinsert = (sqlrequest)
>                  writeln(sqlinsert);
>                  write("|");
>                  auto rs = stmt.executeUpdate(sqlinsert);
>              }
>
>          }
>
> I expect nice progress indicator "|" which move forward after every
> Insert request.
> Like:
> ||||
> and so on.
>
> The problem that App wait some time and only in prints a heap of "|". Why?

That writeln won't be helping anything. Other then that?
No idea sorry.
January 15, 2015
On Thursday, 15 January 2015 at 12:05:24 UTC, Suliman wrote:
> 		void IMGsInsert(string [] fullimgurl)
> 		{
> 			foreach (url; fullimgurl)
> 			{
> 				string sqlinsert = (sqlrequest)
> 				writeln(sqlinsert);
> 				write("|");
> 				auto rs = stmt.executeUpdate(sqlinsert);
> 			}
>
> 		}
>
> I expect nice progress indicator "|" which move forward after every Insert request.
> Like:
> ||||
> and so on.
>
> The problem that App wait some time and only in prints a heap of "|". Why?

Terminal output is line-buffered by default. To display an incomplete line to the user, add "stdout.flush()" after your "write" call.