www.jetdv.com Forum Index Edward Troxel
Vegas Scripting and Newsletters
Home of Excalibur and Montage Magic
 
 FAQ   Search   Memberlist   Usergroups   Register   Profile 
 Log in to check your private messagesLog in to check your private messages   Log inLog in 

Storing variables in the project file

 
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ
View previous topic :: View next topic  
Author Message
captainhanky



Joined: 13 Nov 2005
Posts: 26

PostPosted: Mon Nov 28, 2005 12:12 am    Post subject: Storing variables in the project file Reply with quote

Hello!

Is there a way to store variables in the project, or have I to do this with help of an external file?

I had the idea to write the variables as a track- name on a track,
but somewhere I read about a note (comment) possibility on each track, but I canīt find something like that in the API.
Back to top
View user's profile Send private message
captainhanky



Joined: 13 Nov 2005
Posts: 26

PostPosted: Mon Nov 28, 2005 12:17 am    Post subject: Reply with quote

oh, I found in the class SummaryProperties "String Comments ".

Can I use this, or anything similar, to store variables?
Back to top
View user's profile Send private message
captainhanky



Joined: 13 Nov 2005
Posts: 26

PostPosted: Mon Nov 28, 2005 12:53 am    Post subject: Reply with quote

I found:

Vegas.Project.Summary.Comments = "test";

to write something and

var blah = Vegas.Project.Summary.Comments;

to read.

But how can I make some kind of "field", where I can write and read a specific location of this "memory"?

..and how can I convert the different variable- types to string type and back to the original variable- type?
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Mon Nov 28, 2005 2:47 am    Post subject: Reply with quote

I use an external file for storing all the defaults for Excalibur. It stores many types of information but they're, ultimately, converted to text. You could store similar information in fields such as "comments" but remember that if other people use the script, they may want to have comments.

Using C#, I frequently use "ConvertTo" to convert between various formats. If you have any specific types of information, that might make it easier to find the exact method needed.
Back to top
View user's profile Send private message Send e-mail
captainhanky



Joined: 13 Nov 2005
Posts: 26

PostPosted: Mon Nov 28, 2005 1:25 pm    Post subject: Reply with quote

Thank you!

I found something interesting at the Sony- Vegas Forum:

"In this version, the TrackEvent.Name property is not used by Vegas
itself but it is saved with the project. It might be a handy place to
stash event-specific data used by your script. The maximum size of
the Name string is 260 (MAX_PATH) characters. No guarantee that a
future version of Vegas will not start using it though."
Back to top
View user's profile Send private message
captainhanky



Joined: 13 Nov 2005
Posts: 26

PostPosted: Mon Nov 28, 2005 7:23 pm    Post subject: Reply with quote

Is there a way to extract individual elements out of a variable of type string?

For example:

"todaymondaycarlhouse"

How can I get access to this string, if I only would know the name (carl)?

Maybe I have to write the string with commas:

"today,monday,carl,house"

..but how can I tell an array, that "today" "monday" "carl" "house" are individual elements of this array, so I can read out the array like that:

testarray = new array;
(unknown code)
name = testarray[3];

Thanks!
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Mon Nov 28, 2005 10:56 pm    Post subject: Reply with quote

You can use the substring command to look at any particular subset of information. I'll try to look up some more information more related to this question later (I'm not at my home computer with the info on it right now)
Back to top
View user's profile Send private message Send e-mail
captainhanky



Joined: 13 Nov 2005
Posts: 26

PostPosted: Mon Nov 28, 2005 11:09 pm    Post subject: Reply with quote

I found the split method, which is working fine (opposite of the join method)

Thanks anyway
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Tue Nov 29, 2005 3:18 am    Post subject: Reply with quote

Yes, that is what I had in mind. Here's the basics using TAB as the delimiter:

var ts : String = t;
var delim : Char = "\t";
var split = new Array(7);
split = ts.Split(delim);
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    www.jetdv.com Forum Index -> Scripting FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.11 © 2001, 2002 phpBB Group