skill syntan in combining a name and a variable

R

Rick

Guest
I need to expand on this code and drawing blank on the right
syntax.

multiThread = "+mt=numThreads" <--numThreads needs to be evaluated
so the result will look like below

original working code but multiThread was hardcode

if( mtOption=="Manual" then
if(numThreads > 3 && numThreads < 17 then
multiThread = "+mt=16"
)
if(numThreads > 1 && numThreads < 5 then
multiThread = "+mt=4"
)
if( numThreads== 1 then
multiThread = "-mt"
)

);if MT=Manual
 
Rick <rmattern@inphi.com> writes:

I need to expand on this code and drawing blank on the right
syntax.

multiThread = "+mt=numThreads" <--numThreads needs to be evaluated
so the result will look like below

original working code but multiThread was hardcode

if( mtOption=="Manual" then
if(numThreads > 3 && numThreads < 17 then
multiThread = "+mt=16"
)
if(numThreads > 1 && numThreads < 5 then
multiThread = "+mt=4"
)
if( numThreads== 1 then
multiThread = "-mt"
)

);if MT=Manual
Does sprintf(multiThread "+mt=%d" numThreads) do what you want?

Yours

--
Jean-Marc
 
On Mar 2, 5:50 am, Jean-Marc Bourguet <j...@bourguet.org> wrote:
Rick <rmatt...@inphi.com> writes:
I need to expand on this code and drawing blank on the right
syntax.

 multiThread = "+mt=numThreads"   <--numThreads needs to be evaluated
so the result will look like below

original working code but multiThread was hardcode

         if( mtOption=="Manual" then
          if(numThreads > 3 && numThreads < 17 then
            multiThread = "+mt=16"
               )
        if(numThreads > 1 && numThreads < 5 then
            multiThread = "+mt=4"
               )
        if( numThreads== 1 then
            multiThread = "-mt"
               )

         );if MT=Manual

Does sprintf(multiThread "+mt=%d" numThreads) do what you want?

Yours

--
Jean-Marc
Yep, thanks!!
 

Welcome to EDABoard.com

Sponsor

Back
Top