Welcome to %s forums

BrainModular Users Forum

Login Register

Scripting: Clearing a Record or Custom Type

I need help on a Patch
Post Reply
sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 02 Sep 2016, 02:37

Hi All,

I was curious and trying to find a solution.
I was wondering how you know the default values of a Record or Custom Type such as TMidi?

Also is there a way to clear a Record. I know you could probably create a function to do this, however I am not sure if there is a way to read how many parameters, nor access the parameters generically to do this in a custom function.

-s
"Every act of creation is first an act of destruction." -Picasso

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 02 Sep 2016, 02:52

Well I might have found a solution:

midi_temp := Default(TMidi);

anyone have any better solutions, or know of any deficiencies with using this Default?
-s
"Every act of creation is first an act of destruction." -Picasso

ahonoe
Member
Posts: 161
Location: Toronto
Contact:

Unread post by ahonoe » 07 Sep 2016, 23:48

As far as I know, custom types don't work. Sephult, did you get them to work?
Regards,

Scott

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 10 Sep 2016, 14:58

Hi ahonoe,

Yes Creating your own types/records does work i will try to take some time in near future to update scripting wiki. So when you create a record you have to then create a variable attached to that record name. Like below the record name is (state) so you have to do something like (var loop:state;) then when you access the sub-records you say (loop.start:=45);

type state = record
start:single;
pos:integer;
last:integer;
max:integer;
end;

var loop:state;
----------------------------------------------------------
loop.start:=45;
"Every act of creation is first an act of destruction." -Picasso

Post Reply

Who is online

Users browsing this forum: No registered users and 67 guests