SET_JPOS_REG becomes undefined when %ENVIRONMENT is specifed in karel program

  • I am trying to learn socket programming with Karel and I am following the example program given in the reference manual. I am simulating this on Roboguide with R-30iB controller.

    This is the program code:


    PROGRAM sock_test

    %NOLOCKGROUP

    %NOPAUSE=ERROR+COMMAND+TPENABLE

    %ENVIRONMENT uif

    %ENVIRONMENT sysdef

    %ENVIRONMENT memo

    %ENVIRONMENT kclop

    %ENVIRONMENT bynam

    %ENVIRONMENT fdev

    %ENVIRONMENT flbt

    %INCLUDE klevccdf

    %INCLUDE klevkeys

    %INCLUDE klevkmsk


    VAR

    j1 : JOINTPOS

    j1_deg : ARRAY[9] OF REAL

    status: INTEGER

    status1: INTEGER

    prog_index: INTEGER


    BEGIN

    --j1_deg[1] = 0.0

    --j1_deg[2] = 0.0

    --j1_deg[3] = 0.0

    --j1_deg[4] = 0.0

    --j1_deg[5] = 0.0

    --j1_deg[6] = 0.0

    --j1_deg[7] = 0.0

    --j1_deg[8] = 0.0

    --j1_deg[9] = 0.0


    j1 = CURJPOS(0,0)

    CNV_JPOS_REL(j1, j1_deg, status)


    j1_deg[2] = 0


    CNV_REL_JPOS(j1_deg, j1, status)


    IF status = 0 THEN

    SET_JPOS_REG(1, j1, status1)

    CALL_PROG('TEST1', prog_index)

    ENDIF



    END sock_test


    When I build this, I get the following error:


    41 SET_JPOS_REG(1, j1, status1)

    ^ ERROR

    Id must be defined before this use. Id: SET_JPOS_REG



    ===============Translation not successful===============

    Build Failed: Error translating program: Code: 0xFFFFFFFF:


    But if I comment out the %ENVIRONMENT lines, it builds correctly. Can somebody tell me what am I missing?


    Thank you.

Advertising from our partners