Luca you need to think again
I'm trying right now (2 am!)
First "project":
'non-ui project!!!
Sub AppStart (Args() As String)
DoSomething
StartMessageLoop
Log("done!")
End Sub
Sub DoSomething
For i = 1 To 10
Log(i)
Sleep(100)
Next
StopMessageLoop
End Sub
1) "app" starts;
2) call DoSomething;
3) first log: 1:
4) Sleep 100 means: "system, do whatever you want, but after 100 (ms? I hope, I have to read again) give me the control again:
5) StartMessageLoop - I thought that this was to be the last statement of AppStart routine, ie that subsequent instructions were not be executed (or at least only after a StopMessageLoop);
6) log done!, because I think that StartMessageLoop takes less than 100ms (but what if not? What if I set Sleep(1)?)
7) log the rest, from 2 to 10, then StopMessageLoop.
So the log should be: 1, done!, 2,3,4,5,6,7,8,9,10.
------------------
Second "project":
'non-ui project!!!
Sub AppStart (Args() As String)
For i = 1 To 10
Log(i)
Sleep(100)
Next
StartMessageLoop
Log("done!")
End Sub
1) log 1;
2) Sleep for 100ms, don't stopping the thread (main); but there are no other subs to be executed, then wait 100ms and execute Next.
So the log should be: 1,2,3,4,5,6,7,8,9,10, (StartMessageLoop), done!
[same as
@Toley's "result"
#79]
[Now I have one neuron only; the other is dead

]