Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 19th, 2024, 1:22 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Script instead of program components
PostPosted: March 13th, 2017, 9:25 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
I am looking for an easier way to program by using a script instead of the pre programmed components.
Under the button in the example you find the functions i need to program.
It have to be done for 150 times :(

Can someone show me how it looks in a script so i can make it complete in a script.
Hope to hear from one of you.

Kind Regards, Ad


You do not have the required permissions to view the files attached to this post.

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Script instead of program components
PostPosted: March 13th, 2017, 10:02 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Code:
if (Nr ==1) {
N001 = Rider;
A001 = Time;
S001 = Straf;

for (var i=0;i<=150;i++){        
  if (Straf == i){            
   t001 = Time;         
   t001+= i * 100;         
  }                  
}
}


</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
 Post subject: Re: Script instead of program components
PostPosted: March 13th, 2017, 10:41 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Hi Mac,

Almost perfect...
When the time is 33.45 and Straf = 4 the result is now 33.45400
The value should be 433.45

Kind Regards, Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Script instead of program components
PostPosted: March 14th, 2017, 7:49 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It shouldn't if you are putting numbers into the variables. That result is a concatenation, so one of your variables is being treated as a string.

Either make sure that numbers go in or type convert them before calculation:

Code:
if (Nr ==1) {
N001 = Rider;
A001 = Time;
S001 = Straf;

for (var i=0;i<=150;i++){       
  if (Straf == i){           
   t001 = String.number(Time);  //type converting the Time variable to ensure it's a number 
   t001+= i * 100;         
  }                 
}
}


</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
 Post subject: Re: Script instead of program components
PostPosted: March 14th, 2017, 10:24 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Thanks Mac, this is the solution.

Greetings, Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group