cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate units

Level 11

How to validate units

Dear folks,

I've created some functions each with a rather long argument list. In order to check whether I didn't mix up the order of said arguments I'd like to validate whether the argument has the proper unit.

However, using UnitsOf in a boolean comparison works only partially; i.e. the proper unit is recognized whereas the wrong unit halts the entire function. Does anybody has a strategy (MAthCad 15 please) how to check for units?

Thanks in advance

Raiko

7 REPLIES 7

Re: How to validate units

If you can read a little russian see here - http://twt.mpei.ac.ru/ochkov/T-2011/Chapter2-Units.pdf - pic. 2.14 etc

Highlighted

Re: How to validate units

Hello Valery,

German, English, French or Latvian - no Russian

Raiko

Re: How to validate units

Raiko Milanovic wrote:

Hello Valery,

German, English, French or Latvian - no Russian

Raiko

Scio omnes linguas mundi! With Goggle Translator

Re: How to validate units

ConeUnit.png

Re: How to validate units

Иногда это выглядит перевод усилия Google, чтобы понять, что это будет выучить язык!

(or, for those of you who don't speak Russian (and for those of you who do!) Curabitur interdum felis translatione labore et videam quanta sit cognoscere lingua!

If all else fails try the original Klingon or, if you're really desparate, English because sometimes it is more effort to understand Google's translation that it is to learn the language!

Re: How to validate units

Could you explain this a little bit more, please? It appears as though you are saying there should be some kind of link between the worksheet level name and the function argument name? This seems to go against the principle that a function's argument names have only local validity. What if the user wants to use h (horizontal) and d (depth) rather then h (height) or d (diameter)?

Мне нравится метод проверки правильности физическими Величинами, что вы даете в верхней части функции.

Stuart

Re: How to validate units

StuartBruff wrote:

Мне нравится метод проверки правильности физическими Величинами, что вы даете в верхней части функции.

I like the method of checking the correctness of the physical quantities that you give at the top of the function (Google Translator!)
Stuart

Спаси тебя Бог!

God save you! (Google Translator!)

Correct translation -Thank You - Спасибо!

I use this method in the WaterSteamPro program - loaded and cloud version.

See please one example of one cloud WSP function:

wspD.png