--- title: "DLO_BAS" type: "article" slug: "dlo_bas" url: "http://localhost/article/dlo_bas/" markdown_url: "http://localhost/article/dlo_bas.md" published_at: "2026-11-11T11:07:30+00:00" modified_at: "2026-11-11T11:07:30+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "DLO_BAS (\"disk label organizer\"), a SuperBASIC program that reads a floppy disk's directory, sorts the file names alphabetically and prints a compact disk label on an Epson-compatible printer in elite, compressed and superscript mode. The article explains the printer control codes, how to adapt the program for microdrives, and how to run it; the sort and qsort procedures came from Sinclair QL World. A sample label and the full listing are included." post_tag: - name: "French language" slug: "french-language" taxonomy: "post_tag" url: "http://localhost/tag/french-language/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Superbasic (programming language)" slug: "superbasic-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/superbasic-programming-language/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Real Gagnon" slug: "real-gagnon" taxonomy: "indiv" url: "http://localhost/indiv/real-gagnon/" publication: "QL_DOC" publication_r: id: 52925 title: "QL_DOC" type: "periodical" url: "http://localhost/periodical/ql_doc/" authors: "Réal Gagnon" issue: "2" issues_articles: - id: 76708 title: "QL_DOC n2" type: "issue" url: "http://localhost/issue/ql_doc-n2/" pages: "5-9" pubdate: "February-March 1988" archive_link: false volumeissue: "n2" --- # DLO_BAS **In English:** DLO_BAS ("disk label organizer"), a SuperBASIC program that reads a floppy disk's directory, sorts the file names alphabetically and prints a compact disk label on an Epson-compatible printer in elite, compressed and superscript mode. The article explains the printer control codes, how to adapt the program for microdrives, and how to run it; the sort and qsort procedures came from Sinclair QL World. A sample label and the full listing are included. *The article below is in French, as printed in QL_DOC n2 (February-March 1988).* *** DLO_BAS est un programme qui vous permet de faire de jolies étiquettes pour vos disquettes. En principe, le programme fonctionne avec un QL avec de FLPs mais il peut être facilement modifié pour fonctionner seulement avec des µdrives. Le problème avec ceux-çi est qu’ils sont trop petits pour pouvoir coller une étiquette! Mais enfin, pour la modification, changez les “FLP1” pour des “MDV1” aux lignes suivantes: 185,330,340,350,360,570,750. Pour l’impression, votre imprimante doit être EPSON compatible. Pour mettre le plus d’informations possibles sur l’étiquette, nous mettons l’imprimante en mode ELITE, COMPRESSE, SUPERSCRIPT, avec un interligne de 16/216″. Voici les codes de contrôle nécessaires: ``` ELITE -> ESC "M" COMPRESSE -> CHR$(15) SUPERSCRIPT -> ESC "S0" INTERLIGNE -> ESC "3" CHR$(16) ``` Vérifiez si votre votre imprimante supporte ces codes… Pour démarrer le programme faites LRUN xxxx_DLO_BAS. La première question est pour déterminer sur quel “DEVICE” vous voulez faire un “DIRECTORY”. Si on fait l’étiquette de la disquette présente dans FLP1_, on écrit FLP1_. Puis on peut mettre un commentaire ou un titre, sinon on fait simplement ENTER. Le DIRECTORY sera alors classé en ordre alphabétique. Pour imprimer l’étiquette, on fait LISTE_PRT. NOTE: Les procédures SORT et QSORT, ont pour source le magazine SINCLAIR QL WORLD. [![exemple d'étiquette](http://localhost/wp-content/uploads/2026/11/qldoc-n02-dlo-bas-1-1024x348.png)](http://localhost/wp-content/uploads/2026/11/qldoc-n02-dlo-bas-1.png)exemple d'étiquette ``` 100 REMark disk label organizer .5 par GAG-o86 MTL 110 : 120 WINDOW 512,256,0,0 130 BORDER 3,45 140 PAPER 0:INK 7 150 CLS 160 PRINT "IMPORTANT: La disquette dans FLP1_ ne doit pas être protégée" 170 PRINT " en ecriture."\ 180 INPUT '"Directory" de quel "Device" (ex. flp1_ mdv1_) ? ';dev$ 185 IF dev$='':dev$='flp1_' 190 INPUT 'Un titre général ou commentaire ? ';titre$ 200 read_dir :REMark lecture du directory 210 display_files :REMark montre les fichiers 220 sort fi$ :REMark classé en ordre alphabetique 230 display_files :REMark montre les fichiers en ordre 240 BEEP 1000,10 250 CSIZE#0,1,0 260 BORDER#0,1,7 270 PRINT#0,'FAITES LISTE_PRT -> pour imprimer' 280 CSIZE#0,0,0 290 STOP 300 : 310 : 320 DEFine PROCedure read_dir 330 DELETE flp1_dir1 340 OPEN_NEW#5,flp1_dir1 350 DIR#5,dev$ 360 CLOSE#5:OPEN#5,flp1_dir1 370 : 380 REMark trouve l'espace prise sur disque 390 : 400 CLS 410 INPUT#5,fr_sp$ 420 PRINT fr_sp$ 430 : 440 REMark compte les fichiers et trouve le plus long 450 : 460 INPUT#5,dummy$ :REMark espace vide 470 nfiles=0 480 lmax=0 490 REPeat loop 500 INPUT #5,a$ 510 IF EOF(#5):EXIT loop 520 lfi=LEN(a$) 530 IF lfi>lmax:lmax=lfi 540 nfiles=nfiles+1 550 END REPeat loop 560 PRINT 'il y a ';nfiles;' fichiers sur cette disquette!' 570 CLOSE#5:OPEN#5,flp1_dir1 580 INPUT#5,dummy$:INPUT#5,dummy$ :REMark espace disponible + vide 590 : 600 REMark creation du tableau contenant les fichiers... 610 : 620 DIM fi$(nfiles,lmax) 630 : 640 REMark lecture des fichiers 650 : 660 i=1 670 REPeat loop 680 INPUT#5,a$ 690 IF EOF(#5):EXIT loop:END IF 700 IF a$<>'dir1' 710 fi$(i)=a$ 720 i=i+1 730 END IF 740 END REPeat loop 750 CLOSE#5:DELETE flp1_dir1 760 END DEFine 770 : 780 : 790 DEFine PROCedure display_files 800 f=1 810 PRINT 820 FOR i=1 TO INT(nfiles/5) 830 FOR ii=0,15,30,45,60 840 PRINT TO ii,fi$(f); 850 f=f+1 860 END FOR ii 870 PRINT 880 END FOR i 890 l=0 900 FOR i=f TO nfiles 910 PRINT TO l,fi$(i); 920 l=l+15 930 END FOR i 940 END DEFine 950 : 960 : 970 REMark procedures sort & qsort, source SINCLAIR QL WORLD! 980 : 990 DEFine PROCedure sort (array) 1000 PRINT \ 1010 INK 4 1020 PRINT 'Je fais le classement...'\ 1030 INK 7 1040 qsort array,1,DIMN(array) 1050 END DEFine sort 1060 : 1070 DEFine PROCedure qsort (array,bottom,top) 1080 LOCal loop,lo,hi,pointer 1090 lo=bottom:hi=top 1100 pointer=bottom 1110 REPeat loop 1120 IF lo>=hi:EXIT loop 1130 IF array(lo)>array(hi) 1140 temp$=array(lo) 1150 array(lo)=array(hi) 1160 array(hi)=temp$ 1170 IF pointer=lo 1180 lo=lo+1:pointer=hi 1190 ELSE 1200 hi=hi-1:pointer=lo 1210 END IF 1220 ELSE 1230 IF pointer=lo 1240 hi=hi-1 1250 ELSE 1260 lo=lo+1 1270 END IF 1280 END IF 1290 END REPeat loop 1300 IF ABS(top-bottom)<2 THEN RETurn 1310 qsort array, bottom, pointer-1 1320 qsort array, pointer+1, top 1330 END DEFine qsort 1340 : 1350 : 1360 DEFine PROCedure liste_prt 1370 l$=' ' 1380 OPEN#5,ser1 1390 : 1400 REMark imprimante ->ELITE,COMPRESSE,SUPERSCRIPT,interligne 16/216" 1410 : 1420 PRINT#5,CHR$(27);"M";CHR$(15);CHR$(27);"S0";CHR$(27);"3";CHR$(16); 1430 PRINT#5,CHR$(27);'W1';titre$fr_sp$;CHR$(27);'W0' :REMark large on/off 1440 nbr_col=6 1450 n_lignes=INT(nfiles/nbr_col) 1460 FOR ligne=0 TO n_lignes 1470 FOR colonne=1 TO nbr_col 1480 IF ((ligne*nbr_col)+colonne)>nfiles:EXIT ligne 1490 long_f=LEN(fi$((ligne*nbr_col)+colonne)) 1500 IF long_f>12 1505 f$=fi$(((ligne*nbr_col)+colonne),1 TO 11) 1510 ELSE 1520 f$=fi$((ligne*nbr_col)+colonne) 1530 END IF 1540 l_f=13-LEN(f$) 1550 PRINT #5,f$;l$(1 TO l_f); 1560 END FOR colonne 1570 PRINT#5 1580 END FOR ligne 1590 PRINT#5,CHR$(27);"@"\\\\\\\:CLOSE#5 1600 END DEFine 1610 : 1620 DEFine PROCedure update 1630 DELETE flp1_dlo_bas 1640 SAVE flp1_dlo_bas 1650 END DEFine ```