Skip to main content
1-Visitor
July 30, 2013
Question

Accessing one mathcad script from another

  • July 30, 2013
  • 1 reply
  • 2830 views

Hi,

I need your help in solving the following problem -

Say, i have a main program worksheet ( Say A.xmcd ) where i have my inputs . Now my function ( set of calculations) is in another sheet ( Say B.xmcd )..

Now i need to pass the inputs from A.xcmd to B.xcmd and receive the ouput from B to A .

Say we have a very simple program in A.xcmd

input

x= 3

Function

f=cube (x)

B.xcmd

x1=x

value = x1*x1*x1

return(value)

The above stated are not exactly the syntax but a pseudo code .

How do i link A nd B from A ???

1 reply

25-Diamond I
July 30, 2013

You would have to use "Insert"/"Reference" to achieve what you want.

While it is possible that A references B and also B references A, I wouldn't recommend it. If you use just the function cube() in the attached sheet B, then there would be no need that B references A.

So I would suggest to avoid circular references and that you put your calculations written as functions (like cube()) in sheet B and reference it at the top of sheet A, which takes the input values and uses the functions written in sheet B.

See if the attached would help - it still uses the circular reference which works, because of the very simple mechanism: whenever you insert a reference is is as if you would type the whole content of the referenced file in that position. So see yourself, insert the reference to B in sheet A a second time and look what the value of x is. The function cube() will be defined two times that way which does no harm.

1-Visitor
July 30, 2013

Hey Werner ...

THanks..its working...