--- title: "Trace: Find Strings" type: "article" slug: "trace-find-strings" url: "http://localhost/article/trace-find-strings/" markdown_url: "http://localhost/article/trace-find-strings.md" published_at: "2022-10-07T12:24:46+00:00" modified_at: "2026-08-04T23:20:09+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "So you have tried to sort out variables in a long program to determine what the author is doing and maybe make your own changes. And what about using the same variables for different uses? It gets quite confusing to say the least. This program from \"The Timex Sinclair 2068\" book will give the line…" category: - name: "The Plotter" slug: "the-plotter" taxonomy: "category" url: "http://localhost/category/periodicals/the-plotter/" 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/" 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: "6" issue: "2" issues_articles: - id: 39456 title: "The Plotter v6 n2" type: "issue" url: "http://localhost/issue/the-plotter-v6-n2/" pages: "7" pubdate: "February 1988" archive_link: false --- # Trace: Find Strings So you have tried to sort out variables in a long program to determine what the author is doing and maybe make your own changes. And what about using the same variables for different uses? It gets quite confusing to say the least. This program from “The Timex Sinclair 2068” book will give the line number and statement of occurance (in the line) of any variable you specify. This program will ignore any variable within quotes. Besides regular and string variables it will locate “:”, quotes (press quote key twice), and “$” (to locate all strings used). You must give the computer the variable as it won’t find on it’s own each one that may be in a program. To test it out just try it on itself! This looks like another handy utility to add to your library. ### BASIC Listing ``` 8005 INPUT "Variable to trace ";v$: LET l=LEN v$ 8010 LET p=PEEK 23635+256*PEEK 23636 8020 LET v=PEEK 23627+256*PEEK 23628 8030 LET n=256*PEEK p+PEEK (p+1) 8040 LET le=PEEK (p+2)+256*PEEK (p+3) 8060 LET q=0: LET c=1: FOR j=4 TO le+4 8070 LET p1=PEEK (p+j) 8080 IF p1=34 THEN LET q=NOT q 8090 IF q THEN GO TO 8170 8100 IF p1=14 THEN LET j=j+5: GO TO 8170 8110 IF p1=58 THEN LET c=c+1 8120 IF p1<>CODE v$(1) THEN GO TO 8170 8130 FOR k=1 TO l 8140 LET p1=PEEK (p+j+k-1): IF p1<>CODE v$(k) THEN GO TO 8170 8150 NEXT k: LET k=PEEK (p+j+k-1): IF k=36 OR (k>47 AND k<58) OR (k>64 AND k<91) OR (k>96 AND k<123) THEN GO TO 8170 8160 PRINT FLASH 1; INK 1; PAPER 7;n;: PRINT INK 9;TAB 5;":";c;TAB 10;v$ 8170 NEXT j 8180 LET p=4+p+le: IF p=v THEN GO TO 8195 8190 GO TO 8030 8195 INPUT "DO YOU WANT ANOTHER VARIABLE FOUND? Y/N ";A$: IF A$="Y" OR A$="y" THEN CLS : IF A$="Y" OR A$="y" THEN GO TO 8005: IF A$<>"Y" OR A$<>"y" THEN STOP 8200 SAVE "TRACE" ```