Hello,
I saw some scripting functions (here: https://www.brainmodular.com/manuals/hh4/en/scripting ) about the current date and I'm wondering if anyone already has scripted a patch with 3 outlets (year, month, day), be it strings or integers, please?
creal.
Script that outlets the date of the current day (year, month, day)
-
creal
- Member
- Posts: 96
Hello,
I tried to make a script but I'm really a noob even if years ago I learnt several languages on a basic level. Unfortunately, I just don't have the time to dive into.
I attached the script as well as a screenshot of date and time functions, taken from the official script references of Usine, available here: https://www.brainmodular.com/manuals/hh4/en/scripting
If someone has the time to tell me what's wrong with my code, I would be grateful.
Thanks,
creal.
I tried to make a script but I'm really a noob even if years ago I learnt several languages on a basic level. Unfortunately, I just don't have the time to dive into.
I attached the script as well as a screenshot of date and time functions, taken from the official script references of Usine, available here: https://www.brainmodular.com/manuals/hh4/en/scripting
If someone has the time to tell me what's wrong with my code, I would be grateful.
Thanks,
creal.
You do not have the required permissions to view the files attached to this post.
- senso
- Site Admin
- Posts: 4434
- Location: France
- Contact:
hello,
No chance to compile.
A script should have an 'INIT' and a 'PROCESS' procedure
Here is the correct script, I hop it will help.
No chance to compile.
A script should have an 'INIT' and a 'PROCESS' procedure
Here is the correct script, I hop it will help.
Code: Select all
//////////////////////////
// Decode date
/////////////////////////
// declaration
var year,month,day : Tparameter;
// decode
procedure Init;
begin
year:=CreateParam('year',ptDataField,pioOutput);
year.MinMaxNoLimit(true);
month:=CreateParam('month',ptDataField,pioOutput);
month.MinMaxNoLimit(true);
day:=CreateParam('day',ptDataField,pioOutput);
day.MinMaxNoLimit(true);
end;
//PROCESS
PROCEDURE PROCESS();
var y,m,d : uInt16;
BEGIN
DecodeDate(Date,y,m,d);
year.asinteger(y);
month.asinteger(m);
day.asinteger(d);
END; Olivier Sens
www.brainmodular.com
www.brainmodular.com
- senso
- Site Admin
- Posts: 4434
- Location: France
- Contact:
tanks++++
Olivier Sens
www.brainmodular.com
www.brainmodular.com
