Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #39078
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Arno Welzel <usenet@arnowelzel.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: boolean while loops "how to stop" and "make room for textout to textarea" |
| Date | Sun, 1 Nov 2020 13:52:52 +0100 |
| Lines | 43 |
| Message-ID | <i07pd3Fk95bU1@mid.individual.net> (permalink) |
| References | <6d2d33cc-9b19-469c-a25c-d8d2f862f0aco@googlegroups.com> <ba111515-c079-49bc-939b-bdc8eaf5279ao@googlegroups.com> <314f637c-5652-49f0-b79c-356f95244328o@googlegroups.com> <2397252d-ca36-4e93-8d73-88816bf4fabeo@googlegroups.com> <i05md7F71etU1@mid.individual.net> <72ba1be0-524c-4f9b-aef7-4bae15ab7f20o@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net vgyepC20koIlucCCFhprTgYpDqq9fDXoZqZ2gDCHscVR+JslyQ |
| Cancel-Lock | sha1:UtyNvJC+cn87lvlN9zUVw5gseE0= |
| In-Reply-To | <72ba1be0-524c-4f9b-aef7-4bae15ab7f20o@googlegroups.com> |
| Xref | csiph.com comp.lang.javascript:39078 |
Show key headers only | View raw
Jonas Thörnvall:
> Den lördag 31 oktober 2020 kl. 18:49:37 UTC+1 skrev Arno Welzel:
[...]
>> Just creating a loop which never exists as long as "run" is not false
>> does not work if this should be something useful in the browser.
>>
>> That's the reason where there are functions like setTimeout() or
>> setInterval() to keep things running in JavaScript while still being
>> able to handle events caused by the user.
>>
>>
>> --
>> Arno Welzel
>> https://arnowelzel.de
>
> No you are so wrong Arno, a programming language ***must*** be able to handle.
The language has nothing to do with it. I am talking about how a UI and
multithreading works in general. If there is only one thread there is no
way to handle UI events as long as the thread is inside a while() loop.
Do you even know, what threads in software are?
> Letting UI set a boolean to stop a loop, javascripts idea of invent idiot syntax to replace the obvious, is so incredible stupid it must been invented by an ENTP.
The click event WILL NOT be handled, as long as your code is still
inside a loop!
> while (run==true){}
>
> And then from UI call a function to set the run boolean false, is how things should work ***anything else is just nonesense, making no sense***. There is nothing wrong with setInterval and setTimout. But they fucking should not replace set the boolean to false.
The problem is, that the click handler will not be called as long as
your code is inside the while() loop because there is only one thread
which either runs your code OR handles UI events.
Please try at least to learn what multithreading and event handling means.
--
Arno Welzel
https://arnowelzel.de
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 03:44 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 04:20 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Julio Di Egidio <julio@diegidio.name> - 2020-10-31 06:07 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 09:41 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 09:45 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 09:48 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Julio Di Egidio <julio@diegidio.name> - 2020-10-31 10:10 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 10:42 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 10:05 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-10-31 18:49 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 11:07 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-11-01 11:39 +0000
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-01 13:52 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Julio Di Egidio <julio@diegidio.name> - 2020-11-01 21:57 -0800
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-11-01 23:44 -0800
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-10-31 18:24 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 10:44 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-10-31 18:52 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-10-31 11:14 -0700
Re: boolean while loops "how to stop" and "make room for textout to textarea" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-11-01 11:45 +0000
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-01 14:02 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-11-01 17:38 +0000
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-01 21:07 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" John G Harris <niam@jghnorth.org.uk.invalid> - 2020-11-02 19:36 +0000
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-03 18:34 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Julio Di Egidio <julio@diegidio.name> - 2020-11-03 11:48 -0800
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-04 15:17 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-04 15:18 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Julio Di Egidio <julio@diegidio.name> - 2020-11-04 12:52 -0800
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-05 16:12 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" Arno Welzel <usenet@arnowelzel.de> - 2020-11-01 14:02 +0100
Re: boolean while loops "how to stop" and "make room for textout to textarea" "sc...@sauyet.com" <scott@sauyet.com> - 2020-11-03 13:27 -0800
Re: boolean while loops "how to stop" and "make room for textout to textarea" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2020-11-03 14:08 -0800
Re: boolean while loops "how to stop" and "make room for textout to textarea" Scott Sauyet <scott.sauyet@gmail.com> - 2020-11-03 17:28 -0800
csiph-web