JavaScript Promises

Hi Clifton,
Did you ever get anywhere with promises? I've been reading all kinds of explanations and tutorials for days and days now but most of them are as clear as mud to me! However, I came across this page https://www.w3docs.com/snippets/javascript/what-is-javascript-version-of-sleep.html and have adapted it to my needs and it seems that, without understanding all the complexities of promises one can still use them.
My problem was with trying to emulate the TB request or VS MsgBox systems. The message box was fine but one key element, the suspension of execution, was missing. I got round this with a horribly clunky system which uses a global variable nextAction and generates huge lists of if ... else if... else if, if nextAction = 1 do this, if nextAction = 2 do that etc. It works but creates an excessive quanity of code, to say the least.
Here is how I have used the 'sleep function'. https://www.mediacours.com/tb_examples/newrequest/ Please have a look at it and tell me if you think it's safe. It seems to work perfectly and effectively suspends execution for as long as is necessary. I have put the TB 9.01 file etc here https://www.mediacours.com/tb_examples/newRequest.zip in case you or anyone else might like to use it. If you can't find anything wrong with the system, I shall apply it to my program which will probably take weeks but will make it much easier to understand and maintain.
John
Did you ever get anywhere with promises? I've been reading all kinds of explanations and tutorials for days and days now but most of them are as clear as mud to me! However, I came across this page https://www.w3docs.com/snippets/javascript/what-is-javascript-version-of-sleep.html and have adapted it to my needs and it seems that, without understanding all the complexities of promises one can still use them.

Here is how I have used the 'sleep function'. https://www.mediacours.com/tb_examples/newrequest/ Please have a look at it and tell me if you think it's safe. It seems to work perfectly and effectively suspends execution for as long as is necessary. I have put the TB 9.01 file etc here https://www.mediacours.com/tb_examples/newRequest.zip in case you or anyone else might like to use it. If you can't find anything wrong with the system, I shall apply it to my program which will probably take weeks but will make it much easier to understand and maintain.
John