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 

converting jscript to c#

 
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: Thu Dec 22, 2005 1:47 pm    Post subject: converting jscript to c# Reply with quote

Hi everyone !

Is there a way to convert jscripts to c#?

..or even a way to compile jscripts?

thanks

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


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Thu Dec 22, 2005 2:00 pm    Post subject: Reply with quote

I did it manually. The two are really very close to begin with. So I just made the few necessary modifications needed in order to meet the c# requirements.
Back to top
View user's profile Send private message Send e-mail
captainhanky



Joined: 13 Nov 2005
Posts: 26

PostPosted: Thu Dec 22, 2005 2:55 pm    Post subject: Reply with quote

I thought I could learn things easier by seeing whats happening in the converted jscript, becouse I do not actually really understand fundamentals in c#.

Like namespaces for example. What is this?

and..
Do I have to make new classes?
Becouse in jscript I havent used to make classes, I only needed to make objects.

And how is it about the syntax of the Vegas API.

For example (jscript):

var env = Vegas.Project.Tracks[selectedtrack].Envelopes[currentEnv];
var envY1 = env.ValueAt(Timecode (Vegas.SelectionStart));
var fadeOutCurve : CurveType = CurveType.Linear;
env1.Points.Add(new EnvelopePoint(Vegas.SelectionStart, envY1, fadeOutCurve));


Can I write that in a likely way in c#?

Sorry for the simplistic questions, but when I get some basics, I can really start with this fascinating combination of Vegas and c#.
Back to top
View user's profile Send private message
Edward Troxel
Site Admin


Joined: 14 Jul 2004
Posts: 5475

PostPosted: Thu Dec 22, 2005 4:31 pm    Post subject: Reply with quote

I recommending getting a book on C# that explains classes and namespaces. There are many available and can be tremendously helpful.

As for your particular code, I usually break things up further but basically you just need to change "var" to the type of variable it really is. For example:

var fadeOutCurve : CurveType = CurveType.Linear;

becomes:

CurveType fadeOutCurve = CurveType.Linear;
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