Karel support

  • Hey guys,


    I'm new to programming with Karel and need to modify an existing tech package for a 3D measurement system. The problem that I'm having is trying to build a file called getPath.KL that I wrote and when doing so I get errors that are listed for a file called iscom_CFG.KL(supplied by customer) that can build successfully. I even have the .pc file in the File tree.


    What I don't understand is why the error path is the .KL file for iscom_cfg and why is it pointing to the iscom_cfg file which compiles without errors?


    Is it possible to write PR[1]=PR[2] in Karel? So far I haven't found code/syntax for that?


    :help: will be much appreciated guys!

  • When you're including iscom_CFG in your getPath the compiler will replace the %INCLUDE iscom_CFG with the contents of iscom_CFG, so you'll get...


    Code
    PROGRAM getPath
    
    
    PROGRAM iscom_CFG
    BEGIN
    END iscom_CFG
    
    
    BEGIN
    END getPath


    ... and it will not compile, because there are 2 program declarations.


    You can import a variable from another program with the syntax:

    Code
    FRAME_OFFSET FROM iscom_CFG : XWZWPR


    as iscom_CFG is doing. (On itself?)


    Maybe iscom_DECL is just the Var FROM iscom_CFG list you have to include, but I'm only speculating.

Advertising from our partners