Question: Error when using Units

I have a problem using variables values that were read form Maple library file (*.mla) with units.

For example:

In the first file called "calculations.mw" I calculate a variable with units and save value to "lib1.mla" file

 

A__1 := Units:-Standard:-`*`(2, Unit('m'))

2*Units:-Unit('m')

(1)

A1 := Units:-Standard:-Unit('m')

Units:-Unit('m')

(2)

savelib('A__1', 'A1', cat(interface(worksheetdir), "\\lib1.mla"))

``

 

 

Download calculations.mw

 

 

In the second file called "document.mw" I can read the value of a variable, but can't use it in expressions:

 

libname := cat(interface(worksheetdir))

"D:\TEMP\MTest"

(1)

A__1

2*Units:-Unit('m')

(2)

A__1

2*Units:-Unit('m')

(3)

2*A__1

Error, (in Units:-Standard:-*) invalid subscript selector

 

A1

Units:-Unit('m')

(4)

A1

Units:-Unit('m')

(5)

2*A1

Error, (in Units:-Standard:-*) invalid subscript selector

 

NULL

 

Download document.mw

 

Where I made a mistake? 

Please Wait...