VERICUT Users' Forum

Due to relentless spammers, we are no longer automatically accepting new forum registrations. If you wish to register for this forum, please send an e-mail to: info@cgtech.com

You are not logged in.

#1 2018-05-02 22:56:17

epoirier
Member
Registered: 2014-06-05
Posts: 14

Parsing program message strings

Hello all,

I'm having trouble with something that should be easy, hoping someone has a solution.

Our post outputs tool messages that look like this: (T217 CEM). I want to parse the "217" and the "CEM" from this string for setting two variables.

I can read through the string character by character but this is very cumbersome. Is there an easier way to do this?

Thank you.

Offline

#2 2018-05-18 13:18:45

MustaphaC
VERICUT Specialist
From: Le Mans, France
Registered: 2004-10-14
Posts: 130
Website

Re: Parsing program message strings

Hi!

You have GetCommentString which can get the comments into a variable, for example in sin840d.ctl it is configured in "Start Of Block processing" with OT="CommentString".
Once the comment is read, "(T217 CEM)" in your case, you can the function INDEX to find "(" and ")" and " " then use the function SUBSTR with the INDEX's found with INDEX function


Mustapha

Offline

Board footer