Variable used by other program

  • I'm trying to delete and then create variables using KCL as follows:


    Code
    KCL> DELETE VAR [program]str_array Y
    KCL> CREATE VAR [program]str_array: ARRAY[3] OF STRING[32]


    This worked the first few times I tried it. Now, no matter what I do, I get the following error when trying to delete:


    'Variable used by other program'


    To make it even worse, it doesn't matter which KAREL variable I try to delete. This is the result I get on any variable from any program. Any ideas?

  • Figured it out. You need to clear the program from memory before you try to delete the variable and re-create it. Then you can copy the file back to mdb: from another device after creating the variable:


    Code
    KCL> CLEAR PROG program Y
    KCL> DELETE VAR [program]str_array Y
    KCL> CREATE VAR [program]str_array: ARRAY[3] OF STRING[32]
    KCL> COPY FILE MC:\program.pc TO MDB:


    You can automate this from within Karel using the KCL() built-in.


    Fun!

Advertising from our partners