Jump to content

Getting PIO info to Record Fields


justin1974

Recommended Posts

Justin,

Each parameter on a PIO is already automatically stored as a field at a record attached to each instance of the PIO, you can find this record using:

GotPIO := GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand);

{GotPIO is a boolean (true/false) variable I invented just to allow me to use the GetCustomObject function, it stores 'true' if it suceeds.}

You can see those records when you perform a Custom Selection looking for a Record/Field value, or when you create a Report.

Create your rectangle PIO or insert some NNA PIOs and have a look at the Custom Selection and Create Report commands at the Organise menu.

[ 02-23-2003, 07:32 PM: Message edited by: Alexandre B A Villares ]

Link to comment

Once you've got a PIO's record you can even set one of it's parameters value from inside it:

IF GotPIO THEN SetRField(objectHand, Getname(recordHand), ParameterName, Num2StrF(ParameterNewValue));

For example, if a boolean parameter PSquare is true, make it set pH to pW...

Please note that when you set a parameter from inside the PIO it's new value is only noticed at the next redraw, so I would recommend setting a second pair of intermediate variables to do the drawing.

[...]

W:=pW;

H:=pH;

IF pSquare & GotPIO THEN BEGIN

SetRField(objectHand, Getname(recordHand), 'H' , Num2StrF(W));

H:=W;

END;

Rect (0,0,W,H);

{not Rect(0,0,pW,pH)}

HTH,

Alexandre

Link to comment

Okay

When using the REPORT function my PIO records are there, but the Resourses folder of the document, nor the Data Tab (on Object Info) show this record format.... Why?.

When I use a VW PIO the Data Tab and Resourse Folder show the record format.

I can do what I need from the report functions, but as matter of interest how do I make the record formats show in the Data tab and see record in resources?.

Link to comment

hello justin,

something i've done in the past is to set an external record to the object from within the pio script.

you should run a GetCustomObjectInfo at the start of your pio script:

result:=GetCustomObjectInfo(name,oh,rh,wh);

NewField('Plug In Record','Plug In Field','Value',4,0);

SetRecord(oh,'Plug In Record');

SetRField(oh,'Plug In Record','Plug In Field',Paramater Value);

just remember that you need to convert the paramater value to a string before you assign the field to the object.

hope this helps,

-jason

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...