Adding more lines to program comment

Adding more lines to program comment

alex.neretin
Enthusiast Enthusiast
455 Views
1 Reply
Message 1 of 2

Adding more lines to program comment

alex.neretin
Enthusiast
Enthusiast

Hello,

when posting a program, the "program comment" get's postet only in one line.

My controll only allows a certan amout of characters in one line.

So I would like the PP to create a new line when the "program comment" goes over (for example) 50 characters.

 

current Line in PP

 

if (programComment) {
writeComment(programComment);
}

 

 

Example

N1
N10 (12345678901234567890123456789012345678901234567890)

N11 (1234) example

-> if the comment between the bracket exceeds more then 50 characters, it should create a new line
N11 (Thu Nov 17 2022 09:06:36)
N12 (Bearbeitungszeit = 0.299 min)
N13 (Machine)
N14 ( vendor: Deckel Maho)
N15 ( model: DMU 50 eVo linear)
N16 (T12 D=4.3 CR=0 TAPER=135deg - ZMIN=-1.891)
N17 (113020 4,3 - Kurzbohrer HSS-E FS 4,3 mm)
N18 G90
N19 G94

 

Best regards

 

0 Likes
Accepted solutions (1)
456 Views
1 Reply
Reply (1)
Message 2 of 2

alex.neretin
Enthusiast
Enthusiast
Accepted solution

Solved

 

if (programComment) {
if (programComment.length>50) {
//writeComment('>50' );
mein_programComment=programComment;
zyklen=100;
while ((mein_programComment.length>50) && (zyklen>0)) {
writeComment(mein_programComment.substr(0,50));
mein_programComment=mein_programComment.substr(50,(mein_programComment.length-50));
zyklen--;
}
writeComment(mein_programComment);
}
else
writeComment(programComment);
}

0 Likes