Guest User

Untitled

a guest
Jun 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. function runScanOfMod()
  2. {
  3. %other = "scripts/*.cs";
  4. %fileObj = new fileObject();
  5. %functionCount = 0;
  6. %dataBlockCount = 0;
  7. for( %file = findFirstFile( %other ); %file !$= ""; %file = findNextFile( %other ) )
  8. {
  9. %localFunc = 0;
  10. %localDB = 0;
  11. %fileObj.openForRead(%file);
  12. while (!%fileObj.isEOF())
  13. {
  14. %line = %fileObj.readline();
  15. %funcPos = strStr(%line, "function");
  16. %dbPos = strStr(%line, "datablock");
  17. if (%funcPos > -1 && (%funcPos < strStr(%line, "//") || strStr(%line, "//") == -1))
  18. {
  19. %functionCount++;
  20. %localFunc++;
  21. }
  22. if (%dbPos > -1 && (%dbPos < strStr(%line, "//") || strStr(%line, "//") == -1))
  23. {
  24. %datablockCount++;
  25. %localDB++;
  26. }
  27. }
  28. echo("File" SPC %file SPC "Functions:" @ %localFunc SPC "Datablocks:" @ %localDB);
  29. %fileObj.close();
  30. }
  31. echo("Functions:" @ %functionCount SPC "Datablocks:" @ %datablockCount);
  32. }
Add Comment
Please, Sign In to add comment