BD Newbie
Joined: 07 Jun 2001 Posts: 10 Location: Canada
|
Posted: Thu Nov 13, 2003 5:13 am Post subject: Templates for VDS 3 |
|
|
Well, I've been doing some scripting for awhile and its been a long time since I have contributed to the form. One of my peeves about VDS 3 (Yes, still in 3 - does what I need it to and with MAC's vdsug - I'm happy) is the lack of a template to start from. I have seen a number of post on the site of what to include and of course like everybody else there's always the faves and then there's the stuff you somtimes would like. What I have done is created a template and and exe "Tool" to put it into an empty doc.
Heres the code. You can compile this and add it to your tools directory.
Code: |
rem *********************************************************
rem * Program Name:
rem * Authors Name: B. Danino
rem * Program Requirements:
rem * Program Use: Template copier to create new template in a blank rem * editor
rem * Date created: << YYYY-MM-DD >>
rem * Last updated: << YYYY-MM-DD >>
rem *********************************************************
rem ** Variables section
gosub options
TITLE %%AppTitle
DIALOG CREATE,%%AppTitle,-1,0,0,0,ONTOP
gosub List1
wait .2
REM Copy back to editor
window SEND,%W,@CTRL(V)
rem End of script.
:Close
Exit
rem ---begin gosub---
:options
option decimalsep,"."
option scale,96
option fieldsep,"|"
%P = @path(%0)
%%AppTitle = "Template Creator .. by BD"
%%AppVer = 1.00
%%AppBuild = 001
%%Copyright = "Copyright (c) 2003"
REM Grab ID of VDS editor window
%W = @winactive(I)
exit
:List1
list create,1
list loadfile,1,template.tm
clipboard clear
list copy,1
list close,1
exit
|
and heres the template file which is obviously a text file for the above.
template.tm (needs to be in tools folder as well)
Code: | rem ********************************************************
rem * Program Name:
rem * Authors Name:
rem * Program Requirements:
rem * Program Use:
rem * Date created: << YYYY-MM-DD >>
rem * Last updated: << YYYY-MM-DD >>
rem ********************************************************
rem ** Variables section
gosub options
gosub List1
TITLE %%AppTitle
DIALOG CREATE,%%AppTitle,-1,0,0,0
DIALOG ADD,TEXT,TEXT1,53,61,,,This is a test.
DIALOG SHOW
:Evloop
wait event
goto @event()
rem End of script.
:Close
Exit
rem ---begin gosub---
:options
option decimalsep,"."
option scale,96
option fieldsep,"|"
%P = @path(%0)
%%AppTitle = "AppName goes here "
%%AppVer = 1.00
%%AppBuild = 001
%%Copyright = "Copyright (c) 2003"
exit
:List1
List Create,1
List loadfile,1,file.ext
List Seek,1,0
%%CItem = @item(1)
List Close,1
rem ---end gosub--- |
This way you can stick whatever into the template.tm file and a new template is just a click away.
Hope this works well for you.
Last edited by BD on Sat Nov 22, 2003 2:15 am; edited 1 time in total |
|