Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Tomas_V_cz
277 Views, 4 Replies

job-notes- output to the post processor

Hello, I would like to get some data into the program and it occurred to me that "job-notes" (according to the picture) is a good option.

I need to get the data into two lines (it's in the code), but as shown in the picture. The current form is repeated 2 times for me, and I would have to remove 2 lines. The code is as follows:

 

 if (hasGlobalParameter("job-notes")) {
    var notes = getGlobalParameter("job-notes"); 
    if (notes) { 
      var lines = String(notes).split("\n"); 
      for (line in lines) { 
        var comment = lines[line].replace(/^\s+|\s+$/gm,''); 
        if (comment) { 
          writeBlock("*-material:" + (comment))
          writeBlock("*-zmena:" + (comment))
        }
      }
    }
  }
if (programComment) {
   writeBlock("*-poznamka:" + (programComment))
 } else {
    writeBlock("*-poznamka:");
}

 

The current output is like this (it's wrong)

 

1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:11523
6 *-zmena:11523
7 *-material:A
8 *-zmena:A
9 *-poznamka:
10 *-datum: utery, 5. brezna 2024

 

The output should be like this:

 

1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:11523
6 *-zmena:A
7 *-poznamka:
8 *-datum: utery, 5. brezna 2024

 

If I don't enter any data in the notes, the output should be like this:

 

1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:
6 *-zmena:
7 *-poznamka:
8 *-datum: utery, 5. brezna 2024

 

I enter the data here:

Notes1.png

 

Notes2.png

 

Thanks