我想做一个程序来接受通用约束数组,即 ecgReadings 和 eegReadings:
Types declarations:
subtype ecgReadingsSize is Natural range 1..3;
subtype eegReadingsSize is Natural range 1..10;
subtype eegReading is Natural range 0..1; -- eegRReading is 0 or 1
subtype ecgReading is Natural range 2..600; -- Max heart rate 220
type ecgReadings is array (ecgReadingsSize) of ecgReading;
type eegReadings is array (eegReadingsSize) of eegReading;
type eegPartialSums is array (eegReadingsSize) of Natural;
尝试制定通用程序:
package iocontroller is
generic
type ItemType is private;
type Index_Type is (<>); -- Any discrete type
type Array_Type is array (Index_Type range <>) of ItemType;
procedure startIO(inFileName : String; outFileName : String; List:
Array_Type);
测试通用产品
procedure Main is --change name
type MyArray is array (Natural range <>) of Natural;
procedure ecgIO is new startIO(
ItemType => Natural,
Index_Type => Natural,
Array_Type => MyArray
);