Min Function With Variables


EOlsen

Recommended Posts

I was attempting to use the Min() function to adjust the size of a variable and it throws an error. What needs to be changed to correct the following:

 

global w = 56

w = Min({w, 33}) // This line generates C1072 Invalid {} pairing error

 

And of course get the same error using Max() instead of Min().

Link to comment
Share on other sites

You can only put constants inside of {}.  This, btw, is the same as C.  You need to use concat():

 

w = Min(concat(w, 33))

 

(oh, and by constants I do not mean constants defined with "define",  I mean actual constants like 1, 2, 0x0f, etc.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.