Pete,
I wrote a macro which performs a similar function. I don't know if the logic here will 
allow decimals. It takes a grouped quantity of profiles (they must be chained) and 
names them Prof1, Prof2, Prof3, etc, and also counts the # of profiles (variable 
#no_prof, near the end of the macro) in the group to use as a counter in a while 
statement.
The "while" statement uses the counter like this: WHILE(#no_prof>0)

The profiles are identified inside the "while" statement like this: 
...EL=STRTMP("Prof_%no_prof"),...

Maybe you can get some ideas by studying it:

// Production_Milling 11.01
// c:\sc_macro\NAME_PR.mcl
// CREATED: 10/31/00
// BY: Chris kocourek 
//  
STRING:#prof_name
//Get element number of first element in group
#elmt=GRP(1)
//Get element number of last element in group
// to use in WHILE statement
#last_grp=GRP(0)+#elmt-1
NEW_GRP[]
//Keep count of # of profiles
#prof_count=1
WHILE(#elmt<#last_grp)
     PROF_GRP[AR=0, EL=#elmt]
     #prof_name=STRTMP("Prof_%prof_count")
     //Get starting element in profile
     #PROFSE=GRP(1)
     //Get ending element in profile
     #PROFEE=GRP(GRP(0))
     //Name profile
     NAME_ELMT[EL=#PROFSE, EN=STRTMP("%prof_name")]
     NEW_GRP[]
     //Step counter to next element after profile
     #elmt=#elmt+(#PROFEE-#PROFSE)+1
     //Step profile counter
     #prof_count=#prof_count+1
ENDW
//Get # of profiles
#no_prof=#prof_count-1
PAUSE[TX="Macro is finished", LR=9, LC=40, SR=3, SC=5, PT=0]
#PROFSE=1000000
#PROFEE=1000000
#prof_count=1000000
#grp_count=1000000




-----Original Message-----
From: Pete Ruehle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 9:05 AM
To: 'Kelly D. Grills'; 'SmartCam Forum'
Cc: Pete Ruehle
Subject: RE: [mfg-smartcam] combining strings & variables


Kelly:

#count=1
#pw_hd="pock"
#pw_tail="wid"

while(#count<=8)
 #wid=strtmp("#%pw_hd%count%pw_tail")
 <do other stuff here>
 #count=#count+1
endw

The problem here is that, even though #wid = #pock1wid, it is a string
variable and can not be used in any mathematical statements.  #pock1wid was
previously assigned a  decimal value but the strtmp command makes #wid a
string.   Any ideas?  Can a string variable be converted to decimal???

Pete  

-----Original Message-----
From: Kelly D. Grills [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 22, 2002 8:26 PM
To: 'SmartCam Forum'
Cc: [EMAIL PROTECTED]
Subject: Re: [mfg-smartcam] combining strings & variables


On Wed, May 22, 2002 at 11:14:39AM -0400, Pete Ruehle wrote:
>
> Never mind.  I think I have something.

<snip>

Just curious, what did ya' come up with?

Kelly
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================

Reply via email to