Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- Example script demonstrating how to make a new file and
- execute a method on it.
- }
- unit userscript;
- uses mteFunctions;
- var
- aPlugin: IInterface;
- // if you need to use a variable in two or more of the three
- // available entry points (Initialize, Process, Finalize),
- // declare it globally.
- // you can declare helper methods above Initialize/Process/Finalize
- // they are accessible to all methods below them
- procedure SomeMethod(var f: IInterface);
- var
- i: integer;
- begin
- // as a sample, we'll print out the filename
- AddMessage(GetFileName(f));
- // and then loop through the child elements in the file
- // printing out their names
- for i := 0 to ElementCount(f) - 1 do begin
- AddMessage(Name(ElementByIndex(f, i)));
- end;
- end;
- function Initialize: integer;
- begin
- aPlugin := FileSelect('Select the file you wish to use below: ');
- SomeMethod(aPlugin);
- Result := 0;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment