No announcement yet.

Blocks Function Type Override Declaration

  • Filter
  • Time
  • Show
Clear All
new posts

  • Westside
    Not needed, it will simply work in FTC Blocks. Such distinctions (among numeric Java types) are made transparent to the user.

    For more significant differences such as between text, numeric and Boolean types, FTC Blocks will not let the user attach a Block's output/connection tab to the input socket of a Block expecting a different major type. The output Block will 'jump away' from the input socket upon release of the mouse button, rather than engage with the 'click' sound.

    Leave a comment:

  • baqwas
    started a topic Blocks Function Type Override Declaration

    Blocks Function Type Override Declaration


    I'm cloning some Java code into Blocks. I like the fact that the Java Code pane reflects the underlying code of the Blocks programs.

    How do I explicitly override the type declaration from int to double in my Blocks code? The Java Code pane (in Blocks IDE) shows the type as int (for functions that return values).
    • How to change the type declaration from the default?
    • Blocks typed a variable to float?
      • How does that occur?
      • How to change it to double?
    Kind regards.