look4jpg.sml

  Download

More scripts: SML Fundamentals

Syntax Highlighing:

comments, key words, predefined symbols, class members & methods, functions & classes
            
# look4jpg.sml
# list and count number of .jpg files in folder specified by user
# Toshi Waza, OpenGIS 4 Oct 2006
clear();
class FILEPATH myPath  = GetDirectory("c:/data", "Get starting directory ...");
printf("myPath=%s\n\n", myPath);
	class STRINGLIST files;
	string filename$;
   files = myPath.GetFileList("*.jpg");
   printf("Number of JPEG Files = %d\n", files.GetNumItems());
	numeric i;
	for i = 0 to files.GetNumItems() -1 	{
		filename$ = myPath.GetPath() +"/"+ files[i];
		printf("JPEG %d in : %s\n", i+1, filename$);
   }
print("Done");