FSEINIT:
      /* Assign a fileref to the directory containing     */
      /*    image files.                                  */
   rc=filename("pictures","directory-name");
      /* Assign an identifier to the image.               */
   img_id=picopen(1);
      /* Was the identifier assigned successfully?        */
   if (img_id=0) then
      do;
         _msg_="Image startup error";
         return;
      end;
      /* Initialize the identifier for the screen region. */
   reg_id=0;
   control term;
   return;

INIT:
      /* Does the entry have a value for STYLE?           */
   if (style ne "") then
      do;
            /* Build the filename.                        */
         file=lowcase(style)||".tif";
         img_path=lnamemk(4,"pictures",file,"format=tiff");
         reg_id=picfill(img_id,"image",1,50,20,73,img_path);
      end;
   return;

MAIN:
   return;

TERM:
      /* Remove the image from the region in the screen.  */
   if (reg_id ne 0 and img_id ne 0) then
      rc=picdelete(img_id,reg_id);
   return;

FSETERM:
   if (img_id ne 0) then
      rc=picclose(img_id);
   return;