Variable already creatd Error using MSQM

ckndr47ckndr47 Member Posts: 100
Hello All,

I am calling a code unit that will recieve information from MSMQ, i have set MQBus singleton property to YES and for the first time it works fine, but when i run the same code unit for the second time, i get this error "Variable already created". Though i have tried various things like using the CLEAR function; but still i am unable to sort out this error.

Help me out;

Thanks and Regards,

Comments

  • ckndr47ckndr47 Member Posts: 100
    Here is the code:

    onRun()
    CREATE(Comcom);
    CREATE(MQBus);
    MQBus.OpenReceiveQueue('KHIPC040\private$\test',1,1);
    Comcom.AddBusAdapter(MQBus,1);

    Comcom::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
    InMsg := InMessage;
    InStr := InMsg.GetStream;
    InStr.READTEXT(Line);
    MESSAGE(Line);
  • amunozsuamunozsu Member Posts: 30
    Hi,

    Try this:
    If ISCLEAR(Comcom) THEN
       CREATE(Comcom)
    If ISCLEAR(MQBus) THEN
       CREATE(MQBus)
    
    


    -- Alejandro --
  • ckndr47ckndr47 Member Posts: 100
    Hay,

    Its working now;
    Thanks a lot.
Sign In or Register to comment.