Jump to content

BSL:Manual: Difference between revisions

291 bytes removed ,  23 November 2019
uh, sleep doesn't operate in whole seconds; better getter example
(clarifying that bool variables are broken, not necessarily bool functions; wording; typo fix)
(uh, sleep doesn't operate in whole seconds; better getter example)
Line 691: Line 691:
  {
  {
     dmsg("hey");
     dmsg("hey");
     sleep(1);
     sleep(15);
     fork hey();
     fork hey();
  }
  }
Line 708: Line 708:
   
   
  schedule hey() repeat 0 every 60;
  schedule hey() repeat 0 every 60;
Note the significant difference between the built-in "sleep" function, which operates in whole seconds, and the "schedule" commands, which operate in ticks (1/60 of a second). Using "schedule" gives you much greater control over the timing of BSL execution than a "fork"+"sleep" loop would.


==Variables==
==Variables==
Line 722: Line 720:
...but not when getting or setting its value later:
...but not when getting or setting its value later:


if (i eq 0)...
  i = 4;
  i = 4;
var int c = i;


==Built-in functions and variables==
==Built-in functions and variables==