home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-07-10 | 1.1 KB | 35 lines | [TEXT/MJUA] |
- MACRO 'Compute';
-
- var
- status,time,grade,i,id,row,col,vars:integer;
- meanTime:real;
-
- begin
-
- GETDATA('HD80:Mrp Project:Data:Ejemplo.surv');
- GET(row,col,vars);{get number of rows columns and selected vars}
- status:= 1;{column location of status var in the data matrix}
- time:= 2; {column location of time var in the data matrix}
-
- {first data is transformed with standard Pascal commands. Long execution time}
- {notice that data is accessed with the custom gDATA[] array definition. }
-
- meanTime:= 0.0;
- for i:= 0 to row - 1 do
- begin
- id:= i * col; {access to the start of the ith row of data matrix}
- meanTime:= meanTime + gDATA[id + time]; {compute average time}
- if gDATA[id + status] = 0 then gDATA[id + status] := -1;
- end;
- meanTime:= meanTime/row;
- WRITE('The average time of the series is :',meanTime);
-
- {now data is transformed with a custom COMPUTE command.Short execution time }
- {notice that data is accessed with the custom rDATA[] array definition. }
- COMPUTE
- if rData[2] > 0 then rDATA[2] := rData[4] * rData[5];
- rData[3]:= abs(rData[1]);
- {you may add any other transform statement below}
- end;{end of COMPUTE command}
- end;{end of MACRO}
-