greentea Posted November 28, 2017 Share Posted November 28, 2017 (edited) Hi all, I am somewhat new to vectorscript, but am familiar with some web coding, so I thought I'd try this out. What I want to do is to make a custom selection of id leaders. For example, the script below selects only the id leaders with tag text variable='34'. I'd like to reuse this script but for other tag text variables. ie, select all id leaders with tag text variable='10' or '25' etc. Can someone tell me where in help I can find out how to edit this script so a dialog box pops up and asks me for tag text variable, and then upon clicking ok, it would go from there? DSelectAll; SelectObj((INSYMBOL & INVIEWPORT & (PON='ID Leader') & ('ID Leader'.'TagText'='34'))); Thanks in advance! Edited November 28, 2017 by greentea Quote Link to comment
MullinRJ Posted November 28, 2017 Share Posted November 28, 2017 T, Here's an example of a short script using a pre-defined String Dialog to get you started. Modify to your heart's content. PROCEDURE abc; VAR default, result :STRING; BEGIN default := ''; result := StrDialog('Enter Leader text...', default); if not DidCancel then begin DSelectAll; SelectObj( INSYMBOL & INVIEWPORT & (PON='ID Leader') & ('ID Leader'.'TagText' = result) ); end; { if } END; Run(abc); It should read fairly straightforward, except for "DidCancel". Consider "DidCancel" as a global variable that is set to TRUE when a user closes a standard dialog box by pressing the OK button, and is set to FALSE when a user presses the CANCEL button. Word of future caution, don't use the word "DidCancel" as one of your variable or procedure names. ;-O HTH, Raymond Quote Link to comment
greentea Posted November 28, 2017 Author Share Posted November 28, 2017 Wow Raymond, you just saved me days of pouring over the help file and experimenting and troubleshooting. You are awesome! Thanks so much, I know I will learn quite a bit by "reverse engineering" this to figure it out how vectorscript works. Thanks again! Quote Link to comment
MullinRJ Posted November 29, 2017 Share Posted November 29, 2017 T, you are very welcome. One way to learn how the calls are organized is to view the DevWiki or the HTML (on your computer) references using the "View By Class" link (see pic). This will allow you to ignore the majority of calls that probably don't relate to the problem you are interested in solving. With more than 2600 VS calls, filters are highly recommended. Also, keep writing back. Someone is always awake and ready to answer questions. All the best, Raymond Quote Link to comment
Recommended Posts
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.