Error Messages/42524

< Error Messages
Revision as of 18:48, 30 December 2010 by Lchrisman (talk | contribs) (Created page with "= Warning Message = Warning: Attempt to apply the ^ operator to a handle. The result will be «null». Did you intend to operate on the value of the variable point...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Warning Message

Warning:
Attempt to apply the ^ operator to a handle.  The result will be «null».  Did you 
intend to operate on the value of the variable pointed to by the handle?

Cause

You attempted to apply an arithmetic operator to a handle, such as in this example:

MetaVar h := Handle(X);
h^2

A handle is a type of data structure for which it does not make sense to apply arithmetic operations on it. In this example, if you really wanted to square the value of X (where X is the variable pointed to by h), then you need to de-reference the handle first. The following shows one method for doing this by declaring v to be an alias of the thing pointed to by the handle:

LocalAlias v := h do v^2

A second method is:

Evaluate(h)^2
Comments


You are not allowed to post comments.