--- title: "Trace" type: "article" slug: "trace" url: "http://localhost/article/trace/" markdown_url: "http://localhost/article/trace.md" published_at: "2022-10-07T12:26:48+00:00" modified_at: "2026-08-04T21:32:39+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Key in this short listing to trace the variables in your program. Place it in front of your program and GO TO 5 to use it. You will get a list of the lines that the variable you are looking for is in. BASIC Listing 5 INPUT \"Variable to view \",v$: LET l=LEN v$ 10…" category: - name: "SLUG Newsletter" slug: "slug-newsletter" taxonomy: "category" url: "http://localhost/category/periodicals/slug-newsletter/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "Reference" slug: "reference" taxonomy: "post_tag" url: "http://localhost/tag/reference/" - 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/" publication_r: id: 28015 title: "SLUG Newsletter" type: "periodical" url: "http://localhost/periodical/s-l-u-g-newsletter/" issues_articles: - id: 39550 title: "SLUG Newsletter Aug 1987" type: "issue" url: "http://localhost/issue/slug-newsletter-aug-1987/" pages: "2" pubdate: "August 1987" archive_link: false --- # Trace Key in this short listing to trace the variables in your program. Place it in front of your program and `GO TO 5` to use it. You will get a list of the lines that the variable you are looking for is in. #### BASIC Listing ``` 5 INPUT "Variable to view ",v$: LET l=LEN v$ 10 LET p=PEEK 23635+256*PEEK 23636 15 LET v=PEEK 23627+256*PEEK 23628 20 LET n=256*PEEK p+PEEK (p+1) 25 LET le=PEEK (p+2)+256*PEEK (p+3) 30 PRINT n 35 LET q=0: LET c=1: FOR j=4 TO le+4 40 LET p1=PEEK (p+j) 45 IF p1=34 THEN LET q=NOT q 50 IF q THEN GO TO 90 55 IF p1=14 THEN LET j=j+5: GO TO 90 60 IF p1=58 THEN LET c=c+1 65 IF p1<>CODE v$(1) THEN GO TO 90 70 FOR k=1 TO l 75 LET p1=PEEK (p+j+k-1): IF p1<>CODE v$(k) THEN GO TO 90 80 NEXT k: LET k=PEEK (p+j+k-1): IF k=36 OR (k>47 AND k<58) OR (k>64 AND k<90) OR (k>96 AND k<123) THEN GO TO 90 85 PRINT FLASH 1; INK 2; PAPER 7;n;: PRINT INK 9;TAB 5;":";c;TAB 10;v$ 90 NEXT j 95 LET p=4+p+le: IF p=v THEN STOP 100 GO TO 20. 9998 SAVE "TRACE" LINE 0 ```