Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: KooT on February 12, 2010, 09:35:29 pm

Title: Code template - fiest line of operation notes
Post by: KooT on February 12, 2010, 09:35:29 pm
Hello,
im trying to write my code teplate.
I need to get from 'Operation Notes' only first line.
Now i got there (from python template):

%PI=""%
%if genOptGenComments != "T"%
%endTemplate%
$notes = %REPLACE(opNotes, "\n", "\n    ")%
%if $notes != ""%
$notes = %WRAP_COMMENT($notes, genOptWrapComment, "", "")%
%TRIM($notes)%\n
%endIf%


How i can get only first line (to first \n) ?


Thanks for help!
Title: Re: Code template - fiest line of operation notes
Post by: KooT on February 12, 2010, 09:43:15 pm
I got it...


$pos = %FIND(opNotes, "\n")%
$notes = %LEFT(opNotes,$pos)%

:)