Page 1 of 1

Posted: 02 Sep 2016, 02:37
by sephult
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

Posted: 02 Sep 2016, 02:52
by sephult
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

Posted: 07 Sep 2016, 23:48
by ahonoe
As far as I know, custom types don't work. Sephult, did you get them to work?

Posted: 10 Sep 2016, 14:58
by sephult
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;