Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COHey,thanks,I leant very much from your code!I have two questions.Why "Break;" instead of "Exit;"? and When should I use "var" as a function parameter,I couldn't find a useful explanation and you must have at least two I guess!
      singulars
    2. CO'Break' means "Out of the current LOOP" (for etc.) while 'Exit' means "Out of the current CODE BLOCK" (procedure/function etc.). In our concrete case, yes, *is* the same but (imho) is a good coding habbit to terminate the function at the final 'end'. Of course this is a general rule, not a dogma. Let's suppose that someone else takes the code and he decides that after each check he must wipe (IOW fill with #$00) the MemorySignature, regardless of the function's result. Instinctually he'll add a 'for' loop at the end. If there is an 'Exit' in the middle, then that code *sometimes* is skiped.
      singulars
    3. COThere are some ways to pass the parameters. The default one is by value: s:='Foo'; MyFunc(s); Write(s); will write 'Foo' regardless of what is happening inside of MyFunc and this is because 's' is get **copied** inside of the function (in order to protect the 'outside s' from the changes which happen inside of MyFunc) and if 's' is big (many kB) then this can be expensive. Adding a 'var' there, means that _only_ the pointer to 's' (the reference to 's') is passed which is way faster (only few bytes) but this means that any changes which happen inside of your func will be 'visible' outside.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload