Jump to content
Developer Wiki and Function Reference Links ×

Populating Listboxes


Recommended Posts

Alright, this is driving me crazy. I'm trying to write a script that creates a listbox with all of my viewports. Somehow in the execution of the WHILE/DO loop, my script can't find the viewports using the GetType() function. I've also tried using the Eval() function with no luck. I've tried isolating each part of the script, and everything works on its own. For instance, when I assign the viewport's handle explicitly according to the name of an existing VP, the script runs fine and it adds it to the listbox. Unfortunately, when I put it all together, it can't seem to find the viewports, or anything else for that matter. I've even tried changing the object type that it searches for, but it always comes up with nothing. I've run it in the Debugger and VPEval always evaluates to 0. Any thoughts?

Here's the offending snippet

///////////////////////////////////////////

CASE item OF

SetupDialogC:

BEGIN

vpHand := FObject;

WHILE vpHand <> NIL DO

BEGIN

VPeval := GetType(vpHand);

IF (VPeval = 122) THEN

BEGIN

vpName := getName(vpHand);

InsertChoice(11, 0, vpName);

END;

vpHand := NextObj(vpHand);

END;

END;

///////////////////////////////////////////////

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...