4D Delay Process should not accept negative numbers

Working on a procedure that dynamically slows or speeds itself up based on demand.

I had wrongly assumed that Delay Process would take a negative number and either throw an error or no longer delay the process.

Solution: check for negative numbers and pass a positive number into the Delay Process command.

` 4D Server v11.8 HF2
` Running on xserve 10.5.6
C_LONGINT($vl_ticks_to_wait;$vl_ticks_elapsed)

` our standard is to to wait 1 second
$vl_ticks_to_wait:=60

` but in this last cycle we took 2 seconds to execute so we don't want to
` pause just go into the next cycle
$vl_ticks_elapsed:=60*2

While (True)
  ` just go with the concept of a loop here
  ` I would think that this would wait a maximum of 60 ticks down to none at all
  ` but when asked to delay a negative number no error is thrown, the process
  ` just becomes permanently "Delayed"
  Delay Process(Current Process;$vl_ticks_to_wait-$vl_ticks_elapsed)
End While


Author’s Note

Initial md Generated using https://github.com/jsr6720/wordpress-html-scraper-to-md

Original Wordpress categories: [‘4D’, ‘Wish List’]

Original Wordpress tags: “4D”, “Wish List”, “4D”, “delay process”

Original Wordpress comments: None

Significant revisions

tags: 2011, wordpress, txcowboycoder, 4D, wish-list, gotchas

  • May 6th, 2024 Converted to jekyll markdown format and copied to personal site
  • Mar 18th, 2011 Originally published on txcowboycoder wordpress site

EOF/Footnotes