FSEINIT:
   control term;
      /* Initialize the identifier for the image window   */
      /*    task.                                         */
   task_id=0;
      /* Specify the size (in pixels) and location of     */
      /*    the window.                                   */
   width=400;
   height=300;
      /* Coordinate for upper left corner.                */
   x_loc=0;
   y_loc=0;
      /* Create an SCL list to contain the WSIZE command  */
      /*    and its arguments to define the size and      */
      /*    location of the window.                       */
   cmd_id=makelist();
   rc=insertc(cmd_id,"WSIZE",-1);
   rc=insertn(cmd_id,width,-1);
   rc=insertn(cmd_id,height,-1);
   rc=insertn(cmd_id,x_loc,-1);
   rc=insertn(cmd_id,y_loc,-1);
      /* Create an SCL list to pass the command to the    */
      /*    image window task.                            */
   allcmd_id=makelist();
   rc=insertl(allcmd_id,cmd_id,-1);
      /* If the SCL list exists, start the image window   */
      /*    task.                                         */
   if (task_id=0) then
      task_id=imginit(allcmd_id);
      /* If the window fails to open...                   */
   if (task_id=0) then
      _msg_="Unable to open the Image window";
      /* If the window opens...                           */
   else
      _msg_="The Image window may be under this window";
      /* Assign a fileref to the directory containing     */
      /*    image files.                                  */
   rc=filename("pictures","directory-name");
return;

INIT:
      /* Does the entry have a value for PARKCODE?        */
   if (parkcode ne "") then
      do;
            /* Build the filename.                        */
         file=lowcase(parkcode)||".tif";
         img_path=lnamemk(4,"pictures",file,
            "format=tiff");
            /* Read the image file.                       */
         rc=imgop(task_id,"read",img_path);
            /* Display the image.                         */
         rc=imgop(task_id,"paste");
      end;
return;

MAIN:
return;

TERM:
      /* Remove the image from the window.                */
   if (parkcode ne "") then
      rc=imgop(task_id,"destroy");
return;

FSETERM:
      /* Close the image window.                          */
   if (task_id ne 0) then
      rc=imgterm(task_id);
return;