Jump to content

Racking my brain on this IF/THEN selection issue


Recommended Posts

I have written a lot of Vectorscript. I'm no stranger to it, but this problem has gotten me exasperated! I must be missing something ridiculously simple, or my brain is just not functioning.

Here's the idea...an object is selected. If it meets certain criteria, one thing is done. If it meets other criteria, something else is done. One of the things it should check is if the selected object is of a certain type (Lighting Device in Spotlight) and if it has a certain other record assigned to it (here, it's "Strut Info")

I've written a hundred scripts it seems that can select an object based on those criteria, but now having it try to check if the object meets those criteria just isn't working. Here's the current section:

    if ((T='Lighting Device') & (R IN ['Strut Info'])) then begin
      strutname:=getrfield(h,'Strut Info','Name');
      SelectObj((R IN ['Strut Info']) & (S='Strut') & ('Strut Info'.'Name'=strutname));

I get errors with it saying for the "T" and the "R" that "identifier is not declared". Well, of course it's not. In this case, "T" is type of object and "R" is Record. It's a criteria. Apparently this does not work in an If/Then statement. Other than that one line, the script compiles.

The object is selected. I do have a handle to the object in the script..I apparently just don't know how to apply the handle towards an "IF". What am I missing? What simple thing is wrong here?

Edited by SamIWas
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.

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