Dieter @ DWorks Posted March 21, 2006 Share Posted March 21, 2006 how can you call subroutines? Quote Link to comment
MullinRJ Posted March 21, 2006 Share Posted March 21, 2006 They are called from within a VectorScript (VS) program. You can create a new VS with the Resource Browser. At the top of the display, there is a menu to the right of the word Resources. Under that menu there are more menus. Goto New Resources in 'yourfilename' -> VectorScript... If you don't have a VS Palette in your file yet, it will ask you to create one, otherwise it will ask you which palette to add the VS to. Then it will ask you to name the script. THEN, you will have a blank window in which to type or add your script - the VectorScript Editor. A basic program shell with one subroutine in it looks like this: code: procedure SomeName; procedure SubroutineName; { you can also have a parameter list, if needed } Begin { subroutine code goes here } End; BEGIN { VS code here } SubroutineName; { calls your subroutine } { more VS code here } END; Run(SomeName);[/code] I am reading a lot into your question. If I didn't answer what you were interested in, please be more specific. HTH, Raymond Quote Link to comment
Dieter @ DWorks Posted March 22, 2006 Author Share Posted March 22, 2006 That I already knew, the problem is for calling a SUBROUTINE. you can make tools, commands, objects and subroutines, and vw says that these subroutines can be used by different tools and commands etc. so how can you call a subroutine from a tool? Quote Link to comment
MullinRJ Posted March 22, 2006 Share Posted March 22, 2006 You can have $INCLUDE files on your hard drive and reference them from a VS. I don't recommend using this method for everyday tools, from a stability point of view, but there are exceptions. The tool(s) would require one or more files to be present for it to work. If you wanted to give a tool to someone else, he or she would have to install the tool and the $INCLUDE file(s) exactly as you did. However, if you only use this method for development of your tools, it's not a bad way to go. At the end of development, you can encrypt your script and force the compiler to copy all referenced code to your tool, thus making it self contained. (Read about the .px filename extension.) One caveat about this, all code in the $INCLUDE file will be copied to your tool, even routines that are not used. If your $INCLUDE files are big, your tool will larger than needed. HTH, 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.