Difference between revisions of "Error Messages/41051"

(Var..Do to Local..Do)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Message:
+
[[Category: Error messages]]
  
In the call to function [[Handle]], the first parameter, X, does not identify a valid object.
+
==Error message text==
In this case, you are attempting to take the [[handle]] of a temporary local variable.
 
  
= What it means =
+
<pre style="background:white; border:white; margin-left: 1em; font-style:italic">
 +
In the call to function Handle, the first parameter, «X», does not identify a valid object.
 +
In this case, you are attempting to take the handle of a temporary local value.
 +
</pre>
 +
 
 +
== Cause ==
  
 
This error occurs when you do something like:
 
This error occurs when you do something like:
  
[[Var..Do|Var]] x:=1..5 do [[Handle]](x)
+
:<code>[[Local]] x := 1..5 do [[Handle]](x)</code>
 +
 
 +
The [[Local..Do]] construct declares a local value, but a [[Local Value|local value]] is not an actual Analytica object the way a global Variable or even a [[LocalIndex..Do|local index]] is.  Since it isn't an object, you cannot have a handle to it. 
  
The [[Var..Do]] construct declares a local variable, but a local variable is not an actual Analytica object the way a global Variable or even a [[Index..Do|local index]] is.  Since it isn't an object, you cannot have a handle to it.   
+
This particular error is new to release [[Analytica 4.2]].  The situation in which it arises, where the local value is defined to hold an unindexed list, would have permitted the handle to be taken in release 4.1, but the [[handle]] obtained was to an internal temporary object that had no identifier and displayed as a lone dotThis undesirable situation is now flagged in Analytica 4.2.
  
This particular error is new to release 4.2.  The situation in which it arises, where the local variable is defined to hold an unindexed list, would have permitted the handle to be taken in release 4.1, but the [[handle]] obtained was to an internal temporary object that had no identifier and displayed as a lone dot.  This undesirable situation is now flagged in Analytica 4.2.
+
== Remedies ==
  
= Workarounds =
+
If you feel you really do want to take the [[handle]] of «x», perhaps because you want a [[handle]] to an index object, then you probably intended to declare your local identifier using the [[Index..Do]] construct, rather than using the [[Var..Do]] construct.
  
If you feel you really do want to take the [[handle]] of x, perhaps because you want a [[handle]] to an index object, then you probably intended to declare your local variable using the [[Index..Do]] construct, rather than using the [[Var..Do]] construct.
+
==See Also==
 +
* [[Handle]]
 +
* [[Local Values]]
 +
* [[Objects and Values]]
 +
* [[Var..Do]]  
 +
* [[Index..Do]]  
 +
* [[Arrays and Indexes]]

Latest revision as of 23:52, 8 October 2021


Error message text

 In the call to function Handle, the first parameter, «X», does not identify a valid object. 
 In this case, you are attempting to take the handle of a temporary local value.

Cause

This error occurs when you do something like:

Local x := 1..5 do Handle(x)

The Local..Do construct declares a local value, but a local value is not an actual Analytica object the way a global Variable or even a local index is. Since it isn't an object, you cannot have a handle to it.

This particular error is new to release Analytica 4.2. The situation in which it arises, where the local value is defined to hold an unindexed list, would have permitted the handle to be taken in release 4.1, but the handle obtained was to an internal temporary object that had no identifier and displayed as a lone dot. This undesirable situation is now flagged in Analytica 4.2.

Remedies

If you feel you really do want to take the handle of «x», perhaps because you want a handle to an index object, then you probably intended to declare your local identifier using the Index..Do construct, rather than using the Var..Do construct.

See Also

Comments


You are not allowed to post comments.