Vectorworks, Inc Employee klinzey Posted October 15, 2002 Vectorworks, Inc Employee Share Posted October 15, 2002 I'm not 100% positive, but you may be saved by the scope of your procedures. If your code is set up as: Procedure Foo ----Function blah1(x,y,z) ----Function blah2(x,y,z) Procedure Bob ----Function blah1(x,y) ----Function blah2(x,y) Function blah1(x) Function blah2(x) The function called in the main would expect 1 argument, 2 arguments from within the Bob procedure and 3 arguments from within the Foo procedure. I did a quick test of the setup and it compiled in the VS editor, but I didn't actually call any of the functions. [ 10-15-2002, 01:25 PM: Message edited by: klinzey ] Quote Link to comment
Guest Posted October 16, 2002 Share Posted October 16, 2002 I've been told that there is no support in VectorScript for variable length declarations. My problem now is that I have created tools called blah1 and blah2. Both tools $INCLUDE a stdlib that I have created. Now I need to use both tools to create a larger tool. However when I $include these tools into the larger tool I now have multiple declarations of all the stdlib functions because they were included in the smaller tools. How can I deal with this situation? Quote Link to comment
Guest Posted October 23, 2002 Share Posted October 23, 2002 I can see how this would work and you're correct. However the procedures that I am concerned with I would like to put into a stdlib file that I can include into many different files. i.e. I would like to have: foo(x); foo(x,y); foo(x,y,z); all in stdlib.vss that could be included in another tool that I want to create. I'm looking for the power of C include files not just global replacement , which is what I feel I'm getting with the current VS setup. Quote Link to comment
matto Posted October 24, 2002 Share Posted October 24, 2002 not sure if this would work but... can't your scripts have an ability to deal with 'nil' value for varibles x,y or z sure it means you might need to call foo(x,'nil','nil') or foo(x,y,'nil') but you can then also call foo('nil,y,'nil') if that's meaningful too. Quote Link to comment
Guest Posted October 25, 2002 Share Posted October 25, 2002 This would work for handling all my different declarations of foo. However it's ugly! I'm really more concerned with the $include question. How can I include two different smaller tools into a new tool when both of them $include the same procedures and functions found in my stdlib file. I think that the only way to do this is to rely on the scope. Which is a rash. For instance say I have a bunch of defined procedures in stdlib.vss. Then I want to create a file where I will design plumbing tools named plumbing.vss. In here I want to $include the procedures in stdlib.vss so they are globally usable. To do this I simply include the stdlib.vss file at the top of the script. This way each procedure or "tool" in plumbing.vss can use the globally defined procedures. Next I want to create another set of tools called construction.vss. In this file the same thing. I include stdlib.vss in the top of the file so that the tools are global. Now I want to create a file called bathroom_construction.vss which is going to use the tools that are in plumbing.vss and construction.vss. So I want to $include these files at the top of the bathroom_construction.vss file so they are reusable throughout the file. The problem with this is that both the plumbing.vss and construction.vss files have stdlib.vss defined globally. When the VS compiler compiles, it is going to see two sets of stdlib.vss functions globally defined and is going to blow up. You can get around this by $including the plumbing.vss or construction.vss files inside of each individual tool that you make in bathroom _construction.vss But at the same time you wouldn't be able to use tools from both plumbing and construction inside the same procedure because of the stdlib.vss being defined globally in both of these files. Not too mention if plumbing.vss and construction.vss had ten different tools and then were included in bathroom_construction.vss ten times, you can begin to see the impact it would have on your computer when running. Also would if my intentions were to now make a file called house construction which is going to $include bathroom_construction.vss in a couple of places? See my dilemma? I'm trying to rewrite a 600 page minicad script that could be redesigned to only be about 100 or less pages. That is if VS can support what I'm describing. I appreciate the input. 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.