From cbd2cec9e6255b3fe9ae6192c39c117b75625d60 Mon Sep 17 00:00:00 2001 From: "Williams, Gavin J" Date: Fri, 20 Aug 2021 13:28:54 -0400 Subject: [PATCH] Updated Comment Formatting --- Haas_Lathes_BIDC/Bechtel ST-20.cps | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Haas_Lathes_BIDC/Bechtel ST-20.cps b/Haas_Lathes_BIDC/Bechtel ST-20.cps index 9e39a15..3ea940b 100644 --- a/Haas_Lathes_BIDC/Bechtel ST-20.cps +++ b/Haas_Lathes_BIDC/Bechtel ST-20.cps @@ -157,7 +157,7 @@ properties = { title: "Show notes", description: "Writes operation notes as comments in the outputted code.", type: "boolean", - value: false, + value: true, scope: "post" }, useCycles: { @@ -1090,7 +1090,15 @@ function formatComment(text) { Output a comment. */ function writeComment(text) { - writeln(formatComment(text)); + if (text.length > 80) { + var i = 0; + text = text.match(/.{1,80}/g); + while (text[i] != null) { + writeln(formatComment(text[i++])); + } + } else { + writeln(formatComment(text)); + } } function getB(abc, section) {