--- title: "Print Using" type: "article" slug: "print-using" url: "http://localhost/article/print-using/" markdown_url: "http://localhost/article/print-using.md" published_at: "2022-09-14T02:43:11+00:00" modified_at: "2026-07-28T00:04:41+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "The TS 1000, 1500, and 2068 computers do not support this function but many forms of BASIC do. I have had no experience with this function but have noticed its use in some programs so decided it warranted investigating. There appears to be more than one form of PRINT USING. The simplest establishes the form…" category: - name: "The Plotter" slug: "the-plotter" taxonomy: "category" url: "http://localhost/category/periodicals/the-plotter/" post_tag: - name: "Best of Timex/Sinclair 1000 Articles and Documents" slug: "ts1000best" taxonomy: "post_tag" url: "http://localhost/tag/ts1000best/" - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Dick Wagner" slug: "dick-wagner" taxonomy: "indiv" url: "http://localhost/indiv/dick-wagner/" publication_r: id: 21216 title: "The Plotter" type: "periodical" url: "http://localhost/periodical/the-plotter/" authors: "Dick Wagner" authors_r: - name: "Dick Wagner" slug: "dick-wagner" taxonomy: "indiv" url: "http://localhost/indiv/dick-wagner/" volume: "5" issue: "8" issues_articles: - id: 39449 title: "The Plotter v5 n8" type: "issue" url: "http://localhost/issue/the-plotter-v5-n8/" pages: "6, 8" pubdate: "August 1987" related_articles: - id: 43191 title: "PRINTUSING" type: "article" url: "http://localhost/article/printusing/" archive_link: false --- # Print Using The TS 1000, 1500, and 2068 computers do not support this function but many forms of BASIC do. I have had no experience with this function but have noticed its use in some programs so decided it warranted investigating. There appears to be more than one form of PRINT USING. The simplest establishes the form for printing numbers, right justified. The program contains a line such as `10 A$='#####'` where PRINT USING is invoked with a line like `100 LPRINT PRINT USING A$, T`. This will print the number assigned to T. If T is 3 digits long then 2 spaces are printed in front of the 3 digits. A number larger than that assigned to A$ will not be controlled. Some forms of PRINT USING will properly place a decimal point as defined by A$, or add a $ sign in front of all numbers as `10 A$=581.7` and `100 LPRINT PRINT USING $####.##`. This will display $581.70. Using Sinclair methods we can develop a subroutine that will simulate some of these forms of PRINT USING. For the simplest use to right justify a series of numbers we can set it up this way: ### Listing 1 ``` 10 LET PRINTUSING=2200 100 READ A 120 PRINT A 130 IF A<>999 THEN GO TO 100 140 PRINT : RESTORE 150 READ A 160 LET I$="####" 170 LET XI=A 180 GO SUB PRINTUSING 190 PRINT X$ 200 LPRINT X$ 215 IF A<>999 THEN GO TO 150 220 DATA 1,50,100.1,1000,12.346,1023.99,1.1,.0345,999 2200 LET IL=LEN I$ 2220 LET ID=0 2290 LET X$=STR$ INT XI 2430 FOR J=1 TO IL-LEN X$ 2440 LET X$=CHR$ 32+X$ 2450 NEXT J 2490 RETURN ``` This prints DATA, dropping all digits right of the decimal point, and right justifies. To print the numbers in DATA to two decimal places, change lines 130 and 2290 and add lines 2230, 2240, 2270, 2280, 2390. ### Listing 2 ``` 10 LET PRINTUSING=2200 100 READ A 120 PRINT A 130 IF a<>999 THEN GO TO 100 140 PRINT : RESTORE 150 READ A 160 LET I$="####.##" 170 LET XI=A 180 GO SUB PRINTUSING 200 LPRINT X$ 210 IF A<>999 THEN GO TO 150 2200 LET IL=LEN I$ 2220 LET ID=0 2230 FOR J=1 TO IL 2240 LET J$=I$(J) 2270 IF J$=CHR$ 46 THEN LET ID=LEN I$-J 2280 NEXT J 2290 LET x$=STR$ INT (ABS XI*10↑ID) 2300 LET XD=LEN X$-ID 2310 FOR J=0 TO -XD 2320 LET X$="0"+X$ 2330 NEXT J 2380 LET XD=LEN X$-ID 2390 IF ID>0 THEN LET X$=X$( TO XD)+"."+X$(XD+1 TO ) 2430 FOR J=1 TO IL-LEN X$ 2440 LET X$=CHR$ 32+X$ 2450 NEXT J 2490 RETURN ``` For the TS 1000 & 1500 computers use the following program to allow inputting numbers such as are used in the DATA statement. Lines 2200-2490 are the same except for 2440 where 32 (space) is changed to 26, 2270 where CHR$ 46 (.) is changed to ‘.’, and 2290 which is to be changed as: ``` 2290 LET X$=STR$ INT(ABS XI*10**ID) ``` To duplicate the first program just change line 170 so I$=’????’. ### Listing 3 — TS 1000 / TS 1500 ``` 10 LET PRINTUSING=2200 100 INPUT A 120 PRINT A 130 IF a<>999 THEN GO TO 100 160 LET I$="????.??" 170 LET XI=A 180 GO SUB PRINTUSING 200 LPRINT X$ 2200 LET IL=LEN I$ 2220 LET ID=0 2230 FOR J=1 TO IL 2240 LET J$=I$(J) 2270 IF J$="." THEN LET ID=LEN I$-J 2280 NEXT J 2290 LET x$=STR$ INT (ABS XI*10↑ID) 2300 LET XD=LEN X$-ID 2310 FOR J=0 TO -XD 2320 LET X$="0"+X$ 2330 NEXT J 2380 LET XD=LEN X$-ID 2390 IF ID>0 THEN LET X$=X$( TO XD)+"."+X$(XD+1 TO ) 2430 FOR J=1 TO IL-LEN X$ 2440 LET X$=CHR$ 26+X$ 2450 NEXT J 2490 RETURN ``` For readers wishing to investigate more PRINT USING forms plus many other conversions To Sinclair Basic I suggest obtaining the book, CONVERTING TO TIMEX SINCLAIR BASIC by Stuart L. Bird, published by Wayne Green Publications.