Материал из Module developer
Перейти к: навигация, поиск
        if (tName != 1) {  
           // Checking the coinciding names 
           for (var j=0; j<md.length; j++)
           // If the name coincides with the names from the array, then assign to the variable duplicateName = 1 
           if (name == md[j].data) duplicateName=1;
           // If the variable duplicateName = 0, then 
           if (duplicateName == 0) {
              // Checking for non-zero values of the channels 
              if (addDimmer.GetItem("Channelnumber").Text == ) {
                 IR.GetItem(error).GetItem("Button").Text = 'Incorrect value!';
                 // Output of the error popup 
                 IR.ShowPopup(error);
              }
              else { 
                 // Clearing the name at creation 
                 addDimmer.GetItem("NameDevice").Text = ;
                 i = parseInt(addDimmer.GetItem("Channelnumber").Text);
                 // Clearing the EditBox channel at creation 
                 addDimmer.GetItem("Channelnumber").Text = ;
                 // Creating the subdevice 
                 idSub = module.addSubDevice({
        		      Device: device, // Send the device as the main information source 
        		      DeviceName: name  // The device name seen by the user 
     	         });