RETURNED_PARAMETERS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-14 03:47 PM - last edited on ‎2021-09-14 08:59 AM by Noemi Balogh
I'm trying to return some parameters from an object called in the parent object. I have placed the parameter names after the 'END' in the parameter script. In the caller, I'm doing as:
CALL 'childObject' PARAMETERS RETURNED_PARAMETERS param1Then if I try, say
PRINT param1it gives an error: "Unitialised variable"
I tried calling the object in the 3D script, Master script, and the Parameter script, and get the same error.
How do I access the returned parameter? I have tried in a similar way for another set of objects calling another macro, and it worked there. Don't understand what's wrong here..
Thanks
- Labels:
-
Library (GDL)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-14 04:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-14 05:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-14 09:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-15 02:36 AM
dushyant wrote:
Then if I try, sayPRINT param1it gives an error: "Unitialised variable"
Uninitialised variable just means it does not know what type of variable it is, number, string, etc.
Try adding ...
param1 = 0
or
param1 = "" (if it is a string)
Before the CALL command.
That way you are initialising the parameter before you use it.
I think also if you set the parameter in the parameter list of your parent object, that will do the same thing.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-15 06:35 AM
Initialising the variable before the macro call does avoid that error of 'unitialised variable'. But then the value is still not changed.. meaning the macro is not returning it perhaps.
Yes, I had set the parameter in the parent object same as the RETURNED_PARAMETERS. Since it didn't work, I removed them to check if that was clashing with it.
Anyway, I'll check the macro object again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-15 06:53 AM
The object I'm calling is actually a chair so I am calling it in the 3D script. And since I need the dimensions, I am returning the parameters in the macro from the Parameter script.
Does the placement of these in a particular script in both the parent & macro affect in anyway?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-15 07:14 AM
But when I called the same macro in the 3D script, the returned params are not received it seems..
So again, I would like to know if it matters from which script we return the params in the macro and in which script we call it in the caller.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-15 07:36 AM
Ideally master - then all scripts will have access to this returned parameter value.
If you CALL in the 3D script, that parameter value can only be used in the 3D script.
At least that is my understanding of how it works.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-07-15 07:40 AM
So far I observed it just does not retrieve the returned parameters in the 3D script. Anyone, please let me know if it