Saturday, 20 January 2018

More of Win Drives and QPAC2 FILES thing and .jpgs


The previous post outlined how the Q60 here at QL Heaven could have its hard drive configuration modified at boot time using a caddy system to swap the drives. The next question to consider is how the system and programs running within it can know which combination of drives had been configured at boot. The answer is the Environment Variables extension. This is LRESPRed in the boot file just before the selected drive configuration is mounted by the boot. As the drives are mounted the environment variable HDTYPE is set to a value that can be checked in a program to findout which Win drives were mounted without having to test each drive individually and trap errors. Below is a little SBASIC snippet of code that pops up a files window for each drive mounted of whichever type. Set up a little icon in launchpad, click on that and there are files windows for all drives. Handy if you cannot exactly remember which drive had that subdirectory you were looking for. 


1000  EXEP 'Files';'\DWin1_ \C1,2 \O',"Win1_"
1010  EXEP 'Files';'\DWin2_ \C1,2 \O',"Win2_"
1020  EXEP 'Files';'\DWin3_ \C1,2 \O',"Win3_"
1030  EXEP 'Files';'\DWin4_ \C1,2 \O',"Win4_"
1040  IF (GETENV$("HDTYPE")="ALLWINS")
1050    EXEP 'Files';'\DWin5_ \C3,2 \O',"Win5_"
1060    EXEP 'Files';'\DWin6_ \C3,2 \O',"Win6_"
1070    EXEP 'Files';'\DWin7_ \C3,2 \O',"Win7_"
1080    EXEP 'Files';'\DWin8_ \C3,2 \O',"Win8_"
1090  END IF
1100  IF (GETENV$("HDTYPE")="FAT32")
1110      EXEP 'Files';'\DWin5_ \C3,2 \O',"Win5_"
1120  END IF

The program in action below. There are two screen scrapes below. Both .jpg files created on the Q60. The difference between them is the size of the file - approximately 50k for an identical image. The larger file was created using QTImage while the smaller file was created using cjpeg a small very old utility obtained on a floppy disk from PD library some time in the 1990s.

Finally rereading the QPAC2 documentation revealed that the files thing can filter files as well as sorting them. Selecting the F2 source menu, inputting a source drive such as Win2_and adding an extension, Win2__bas will list only all the files with that extension in the given directory. Sometimes useful for searching out that file hidden in plain sight. 


No comments:

Post a Comment