Announcement

Collapse
No announcement yet.

Blocks Programming "MyBlock" capability

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Blocks Programming "MyBlock" capability

    So in EV3 and NXT there is something where you could program something (Ex. A move CM program) and tun it into a block where you could call it from from a different program. I was trying to figure out how to do this for the past couple of days. I know Blocks has functions that you can call from the same Opmode. But is there any way to make a "MyBlock" in Blocks like to call an OpMode from another OpMode?

    --
    Adrian
    FTC 12828
    Critical Overload

  • #2
    Originally posted by Adrian Chan View Post
    So in EV3 and NXT there is something where you could program something (Ex. A move CM program) and tun it into a block where you could call it from from a different program. I was trying to figure out how to do this for the past couple of days. I know Blocks has functions that you can call from the same Opmode. But is there any way to make a "MyBlock" in Blocks like to call an OpMode from another OpMode?

    --
    Adrian
    FTC 12828
    Critical Overload
    Hi Adrian,

    I don't know if the Blocks tool currently supports calling a user defined blocks function from a different op mode. I will check with the Blocks engineer for you on this.

    In the meantime, if you have some functions that you want to re-use throughout your op modes, one thing that you can do is define the function in a Blocks op mode. then, in your second op mode, if you want to reuse this block function, you can copy and paste it from the first op mode to the second.

    Perhaps the MyBlocks feature (user-defined, reusable blocks) is something that can be added in the future, but for now I believe you will have to use cut and paste if you want to replicate code or a function from one op mode to another.

    Tom

    Comment

    Working...
    X