Results 1 to 9 of 9

Thread: "Scripting" language

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    There are some little things you could clean, that compiler still tells

    ignore? - scripting.pas(81,27) Hint: Local variable "c" does not seem to be initialized
    *see below 1) - scripting.pas(212,16) Warning: Local variable "str" does not seem to be initialized
    ignore? - scripting.pas(238,36) Hint: Local variable "c" does not seem to be initialized
    remove - scripting.pas(133,3) Note: Local variable "com" not used
    remove - Unit1.pas(36,23) Hint: Parameter "params" not used
    remove - Unit1.pas(41,29) Hint: Parameter "params" not used
    ignore? - Unit1.pas(63,33) Hint: Local variable "freq" does not seem to be initialized
    ignore? - Unit1.pas(64,32) Hint: Local variable "start" does not seem to be initialized
    ignore? - Unit1.pas(66,31) Hint: Local variable "stop" does not seem to be initialized
    remove - Unit1.pas(6,12) Hint: Unit "messages" not used in Unit1
    remove - ScriptingTest.lpr(12,15) Warning: Symbol "MainFormOnTaskBar" is not portable

    1) Line is str := str + script[i]; where str was not initialized (meaning str := ''; ). It could be that compiler nulls dynamic arrays and strings, but i'm not sure if it does on all possible fpc compilers and their settings.

    Lots of 'Local variable X does not seem to be initialized' could be rid of by changing "var" to "out", but i just recently read that fpc might allocate that parameter for itself, instead of using the parameter reference... That might slow down performance slightly if so.
    edit: In my test app var, out and pointer perform pretty much the same. I had 1 parameter record with 1kb data.
    Last edited by User137; 24-07-2013 at 08:46 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •