I’m in need of some help for an IF statement in a macro.

 

What I’m trying to do with the IF is say…

 

IF the current element, lets say for example E10, is  

a TYP(4) User Element

 

AND

 

it is a string that is EQUAL to @NOSTOP

 

then MODIFY it to @STOP

 

and ENDIF it.

 

This is the IF line from the macro that is not passing go…

 

IF( TYP(#Prof)=4, and STREQUAL(STRSUB(#Prof,1,strlen(#Prof)),@NOSTOP ) ) 

 

 

 

Below is the rest of the macro

 

//PAUSE[TX="The so far so good macro pause!", LR=10, LC=5, SR=2, SC=40, PT=1]

VAR_REMOVE_ALL[]

 

GRAPHICS_Off[]

 

MASK[LY="*", SH=0]// hide all layers

 

MASK[TL="*", SH=1]// show all tools

 

SELECT_ALL[]// select all tool(s) using ++ icon

 

MASK[LY="*", SH=1]// show all layers

 

ELMT_SEQ[BA=1, EL="totel()", ME=0]// Set sequence at end of database

 

// Move selected elements to end of database in the order they were picked

SEQ_MOVE[SC=1]

 

#Start=GRP(1)// Get first element in group

 

#No_Elmt=GRP(0)// Get number of elements in group

 

#End=totel()// Get last element in database

 

NEW_GRP[]

 

 

// put the tool elements into an array

#Count=1

 

STRING:#Name

INTEGER:#Count

INTEGER:#Next

 

#Count=1

 

WHILE(#Start<=#End)

 

     //Name element

     NAME_ELMT[EL=#Start, EN=STRTMP("E%Count") ]

 

     #Start=#Start+1

 

     #Count=#Count+1

 

ENDW

 

 

 

#Count=1 // reset counter

STRING:#Prof // this is the name for E1, E2, E3 etc

 

WHILE(#Count<=#No_Elmt)

 

  #Prof=STRTMP("E%Count")

 

 

IF( TYP(#Prof)=4, and STREQUAL(STRSUB(#Prof,1,strlen(#Prof)),@NOSTOP ) )       ß--------------------- help with this line

 

            ELMT_SEQ[BA=1, EL=STRTMP("E%Count"), ME=1]

 

                        MOD_UEVENT[EL=STRTMP("E%Count"), XS2=ENX(SEQEL()), YS2=ENY(SEQEL()), TX="@STOP", LV=0]

ENDIF

 

     #Start=#Start+1

 

     #Count=#Count+1

 

ENDW

 

GRAPHICS_On[]

 

 

Any help is as usual greatly appreciated.

 

Regards,

Michael Senack

Reply via email to