simple question
simple question
(OP)
Hello fellas,
I have got one simple question - is there in MC possibility to define a constant in such a manner (eg.):
p := r := 10
instead of writing this in two lines:
p := 10
r := 10
or
p := 10
r := p
?
I assume that p and r will always have the same value, but for readability of the further code I want to have a different names of these constants. So, must I write 2 lines?
I have got one simple question - is there in MC possibility to define a constant in such a manner (eg.):
p := r := 10
instead of writing this in two lines:
p := 10
r := 10
or
p := 10
r := p
?
I assume that p and r will always have the same value, but for readability of the further code I want to have a different names of these constants. So, must I write 2 lines?





RE: simple question
You can of course put them on the same line, but that doesn't answer the broader question. You could do it with a vector:
i:0,1;1
pr[i:10
That would let you use pr[0 and pr[1 Still takes two assignments, but if you wanted to assign a dozen variables with the same value it would work.
David Simpson, PE
MuleShoe Engineering
"Belief" is the acceptance of an hypotheses in the absence of data.
"Prejudice" is having an opinion not supported by the preponderance of the data.
"Knowledge" is only found through the accumulation and analysis of data.
The plural of anecdote is not "data"
RE: simple question
RE: simple question
r:10
p:r
or vice-versa.
Mathcad is not intended to be a programming language, so many programming constructs are not appropriate for creating worksheets.
TTFN

FAQ731-376: Eng-Tips.com Forum Policies
Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers