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)
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.
- Attachments
-
- decode date.pat
- (9.93 KiB) Downloaded 240 times
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
Hello,
Thank you very much. Now I think I understand how a simple script works. It works perfectly well.
Here is the final patch for people who need it.
creal
Thank you very much. Now I think I understand how a simple script works. It works perfectly well.
Here is the final patch for people who need it.
creal
- Attachments
-
- decode date working.pat
- (14.8 KiB) Downloaded 239 times
tanks++++
Olivier Sens
www.brainmodular.com
www.brainmodular.com
Who is online
Users browsing this forum: Bing [Bot] and 75 guests
