Re: [M100] Variable Concordance
Spaces as delimiters import into Excel quite nicely too. You just have to check the space box for picking delimiters. For me, using a space as a delimiter is preferred over a tab due to the extra output space required for a tab. For example, in one of my programs, I use the variable “I” all over the place. Here is the variable concordance for the variable, “I”: I 450(3) 470(3) 1330 1350 1360 1390(2) 1400 1410 1440 1530 1550 1560 1580(2) 1590 1600 1610 1830 1840 1850 1880 1890(2) 1910 2110 2130 2140 2150 2160 2170 2250 2260 2270 2290(4) 2330 2390(2) 2410(5) 2440 2450 2470 2480 2570(4) 2580 2610 2640 2740 2840(2) 2850 2890 2930 2950 2970 2990(2) 3000 3010(2) 3020 3030(2) 3040 3050 3100(2) A tab as a delimiter would require many more lines. As far as making it pretty for formal documentation, I will allow the user to do that with their favorite spreadsheet, word processor or if they desire, modify the source code I provided accordingly. This output was meant to be a quick concise output that could be used for debug/development. In a spreadsheet or word processor, it can be dressed up and comments with detailed variable descriptions can be added. Lloyd -Original Message- From: M100 On Behalf Of MikeS Sent: Thursday, May 4, 2023 11:07 PM To: m...@bitchin100.com Subject: Re: [M100] Variable Concordance Yeah, that's what I was suggesting, mainly for legibility; importing into Excel would be a bonus m - Original Message - From: "Bert Put" < <mailto:b...@bertput.com> b...@bertput.com> To: < <mailto:m...@bitchin100.com> m...@bitchin100.com> Sent: Thursday, May 04, 2023 6:41 PM Subject: Re: [M100] Variable Concordance > You might consider using tabs instead of spaces; Excel can import > tab-delimited files just like comma-delimited, and they are still fairly > readable. Just make sure you have only one tab between columns. It > might mess up your spacing a bit. Just a thought. > > Regards,Bert > > > On 5/3/23 17:28, <mailto:lloydel...@comcast.net> lloydel...@comcast.net > wrote: >> Peter, >> >> I had pondered doing something like you suggested. I also thought about >> making everything separated by commas so it would import into Excel. I >> finally settled with keeping it simple and doing spaces.
Re: [M100] Variable Concordance
Yeah, that's what I was suggesting, mainly for legibility; importing into Excel would be a bonus m - Original Message - From: "Bert Put" To: Sent: Thursday, May 04, 2023 6:41 PM Subject: Re: [M100] Variable Concordance > You might consider using tabs instead of spaces; Excel can import > tab-delimited files just like comma-delimited, and they are still fairly > readable. Just make sure you have only one tab between columns. It > might mess up your spacing a bit. Just a thought. > > Regards,Bert > > > On 5/3/23 17:28, lloydel...@comcast.net wrote: >> Peter, >> >> I had pondered doing something like you suggested. I also thought about >> making everything separated by commas so it would import into Excel. I >> finally settled with keeping it simple and doing spaces.
Re: [M100] Variable Concordance
You might consider using tabs instead of spaces; Excel can import tab-delimited files just like comma-delimited, and they are still fairly readable. Just make sure you have only one tab between columns. It might mess up your spacing a bit. Just a thought. Regards,Bert On 5/3/23 17:28, lloydel...@comcast.net wrote: Peter, I had pondered doing something like you suggested. I also thought about making everything separated by commas so it would import into Excel. I finally settled with keeping it simple and doing spaces.
Re: [M100] Variable Concordance
Peter, I had pondered doing something like you suggested. I also thought about making everything separated by commas so it would import into Excel. I finally settled with keeping it simple and doing spaces. To keep the line width reasonable, rather than just repeating the line number each time the variable appears on the same line, I tallied the count and put counts greater than 1 in parenthesis. I even thought about trying to determine which variables are arrays.That gets a bit messy because now I would need to look for the DIM keyword.As far as identifying the type, you can get thrown off if DEFSNG, DEFSTR,DEFDBL, or DEFINT have been used. I suppose one could make the program smart enough to recognize these and type the variables accordingly, but then it gets even more complicated. And as far as the comment of distinguishing between a variable being defined versus being used, that would certainly be useful.There would need to be some code for determining which side of the equal sign the variable is found on. This would require a bit more work because the program currently turns equal signs and colons (and most other symbols) into spaces. I have a few ideas on how to approach this, but it will probably go on the back burner. Perhaps others may want to try tackle these things using the code I provided or starting from scratch. I did do an update on MTVarConcor to handle files that have the last line beginning with a control Z followed by garbage. The updated source and executable is at www.github.com/lej-projects/MTVarConcor <http://www.github.com/lej-projects/MTVarConcor> . It is version 1.1. Thanks for the comments. Lloyd From: M100 On Behalf Of Peter Noeth Sent: Wednesday, May 3, 2023 4:59 PM To: Model 100 Discussion Subject: Re: [M100] Variable Concordance A good idea, but since the program runs under Windows, why such a cryptic output? Wouldn't it be easier to use with more verbose column headers: Variable Type Defined in Line Used in Lines Comments - B% Integer0 1, 7(2) C Double1 2(3), 4, 5(2) E Double1 7(5) . . . The Comments column label would be generated, but used later when the output file is edited to add notes about the variable usage, etc. This would make a good start to proper program documentation. Of course, since the source was provided, changes could easily be made :-) Regards, Peter On Tue, May 2, 2023 at 1:15 PM mailto:m100-requ...@lists.bitchin100.com> > wrote: -- Message: 1 Date: Mon, 1 May 2023 15:31:48 -0500 From: mailto:lloydel...@comcast.net> > To: mailto:m...@bitchin100.com> > Subject: [M100] Variable Concordance - MTVarConcor Message-ID: <000401d97c6b$f4e9acc0$debd0640$@comcast.net <http://comcast.net> > Content-Type: text/plain; charset="utf-8" Hello all, I?ve written a variable concordance program for Windows that will take a TRS-80 Model 100 BASIC program and will list the variables in alphabetical order with the line numbers where they appear.The name of this program is MTVarConcor. The executable, source and a pdf file describing it can be found at www.GitHub.com/LEJ-Projects/MTVarConcor <http://www.GitHub.com/LEJ-Projects/MTVarConcor> <http://www.GitHub.com/LEJ-Projects/MTVarConcor> . As an example, the 10 line program, drop (written by David Plass) is as follows: 0 CLS:POKE-902,PEEK(63795):F=.25+RND(1)/4:W=-.25+RND(1)/2:X=0:Y=1:B%=5+25*RND(1) 1 C=0:PRINT@280+B%,CHR$(27)"V?"SPACE$(9-E)"?":PRINT@200,"S:"S:PRINT"L:"5-L:PRINTUSING"W:#.#";W 2 C=C+F:PRINT@C," ??":IFX<>0THENPRINT@OX+40*OY%," ":OX=X:OY%=Y:Y=Y+.3:X=X+W:GOTO6 4 IFINKEY$=" "THENX=C+2:F=F*2:OX=0:OY%=0 5 IFC>=37THENPRINT@37," ":C=0:GOTO2ELSE2 6 IFY<7.01THENPRINT@X+40*FIX(Y), <mailto:7.01THENPRINT@X+40*FIX(Y),%22?%22:GOTO4%20%0b%0b7%20IFX> "?":GOTO4 7 IFX>=B%+1ANDX<=B%+10-ETHENPRINT@97,"Hit!":CALL4811:S=S+10*(E+1):E=E-(E<8):GOTO0 8 L=L+1:IFL<5THENPRINT@97,"MISS!":CALL4811:GOTO0ELSEPRINT@55,"Game over":END The output from MTVarConcor when the above program is the input is: B% 0 1 7(2) C 1 2(3) 4 5(2) E 1 7(5) F 0 2 4(2) L 1 8(3) OX 2(2) 4 OY% 2(2) 4 S 1 7(2) W 0 1 2 X 0 2(4) 4 6 7(2) Y 0 2(3) 6(2) I hope someone will find this program useful. Lloyd
Re: [M100] Variable Concordance
I think the 'type' could be misleading since it could be redefined with a DEF statement; probably better to put that in the comments later if necessary. Maybe the references could be in columns; most of the cross-references I use do that and it does seem to make it a little easier to read... But it's pretty good as is! m - Original Message - From: Peter Noeth To: Model 100 Discussion Sent: Wednesday, May 03, 2023 5:59 PM Subject: Re: [M100] Variable Concordance A good idea, but since the program runs under Windows, why such a cryptic output? Wouldn't it be easier to use with more verbose column headers: Variable Type Defined in Line Used in Lines Comments - B% Integer0 1, 7(2) C Double1 2(3), 4, 5(2) E Double1 7(5) . . . The Comments column label would be generated, but used later when the output file is edited to add notes about the variable usage, etc. This would make a good start to proper program documentation. Of course, since the source was provided, changes could easily be made :-) Regards, Peter On Tue, May 2, 2023 at 1:15 PM wrote: -- Message: 1 Date: Mon, 1 May 2023 15:31:48 -0500 From: To: Subject: [M100] Variable Concordance - MTVarConcor Message-ID: <000401d97c6b$f4e9acc0$debd0640$@comcast.net> Content-Type: text/plain; charset="utf-8" Hello all, I?ve written a variable concordance program for Windows that will take a TRS-80 Model 100 BASIC program and will list the variables in alphabetical order with the line numbers where they appear.The name of this program is MTVarConcor. The executable, source and a pdf file describing it can be found at www.GitHub.com/LEJ-Projects/MTVarConcor <http://www.GitHub.com/LEJ-Projects/MTVarConcor> . As an example, the 10 line program, drop (written by David Plass) is as follows: 0 CLS:POKE-902,PEEK(63795):F=.25+RND(1)/4:W=-.25+RND(1)/2:X=0:Y=1:B%=5+25*RND(1) 1 C=0:PRINT@280+B%,CHR$(27)"V?"SPACE$(9-E)"?":PRINT@200,"S:"S:PRINT"L:"5-L:PRINTUSING"W:#.#";W 2 C=C+F:PRINT@C," ??":IFX<>0THENPRINT@OX+40*OY%," ":OX=X:OY%=Y:Y=Y+.3:X=X+W:GOTO6 4 IFINKEY$=" "THENX=C+2:F=F*2:OX=0:OY%=0 5 IFC>=37THENPRINT@37," ":C=0:GOTO2ELSE2 6 IFY<7.01THENPRINT@X+40*FIX(Y),"?":GOTO4 7 IFX>=B%+1ANDX<=B%+10-ETHENPRINT@97,"Hit!":CALL4811:S=S+10*(E+1):E=E-(E<8):GOTO0 8 L=L+1:IFL<5THENPRINT@97,"MISS!":CALL4811:GOTO0ELSEPRINT@55,"Game over":END The output from MTVarConcor when the above program is the input is: B% 0 1 7(2) C 1 2(3) 4 5(2) E 1 7(5) F 0 2 4(2) L 1 8(3) OX 2(2) 4 OY% 2(2) 4 S 1 7(2) W 0 1 2 X 0 2(4) 4 6 7(2) Y 0 2(3) 6(2) I hope someone will find this program useful. Lloyd
Re: [M100] Variable Concordance
A good idea, but since the program runs under Windows, why such a cryptic output? Wouldn't it be easier to use with more verbose column headers: Variable Type Defined in Line Used in Lines Comments - B% Integer0 1, 7(2) C Double1 2(3), 4, 5(2) E Double1 7(5) . . . The Comments column label would be generated, but used later when the output file is edited to add notes about the variable usage, etc. This would make a good start to proper program documentation. Of course, since the source was provided, changes could easily be made :-) Regards, Peter On Tue, May 2, 2023 at 1:15 PM wrote: > -- > > Message: 1 > Date: Mon, 1 May 2023 15:31:48 -0500 > From: > To: > Subject: [M100] Variable Concordance - MTVarConcor > Message-ID: <000401d97c6b$f4e9acc0$debd0640$@comcast.net> > Content-Type: text/plain; charset="utf-8" > > Hello all, > > > > I?ve written a variable concordance program for Windows that will take a > TRS-80 Model 100 BASIC program and will list the variables in alphabetical > order with the line numbers where they appear.The name of this program > is MTVarConcor. The executable, source and a pdf file describing it can > be found at www.GitHub.com/LEJ-Projects/MTVarConcor < > http://www.GitHub.com/LEJ-Projects/MTVarConcor> . > > > > As an example, the 10 line program, drop (written by David Plass) is as > follows: > > > > 0 > CLS:POKE-902,PEEK(63795):F=.25+RND(1)/4:W=-.25+RND(1)/2:X=0:Y=1:B%=5+25*RND(1) > > > 1 C=0:PRINT@280+B%,CHR$(27)"V?"SPACE$(9-E)"?":PRINT@200 > ,"S:"S:PRINT"L:"5-L:PRINTUSING"W:#.#";W > > 2 C=C+F:PRINT@C," ??":IFX<>0THENPRINT@OX+40*OY%," > ":OX=X:OY%=Y:Y=Y+.3:X=X+W:GOTO6 > > 4 IFINKEY$=" "THENX=C+2:F=F*2:OX=0:OY%=0 > > 5 IFC>=37THENPRINT@37," ":C=0:GOTO2ELSE2 > > 6 IFY<7.01THENPRINT@X+40*FIX(Y),"?":GOTO4 > > 7 > IFX>=B%+1ANDX<=B%+10-ETHENPRINT@97,"Hit!":CALL4811:S=S+10*(E+1):E=E-(E<8):GOTO0 > > > 8 L=L+1:IFL<5THENPRINT@97,"MISS!":CALL4811:GOTO0ELSEPRINT@55,"Game > over":END > > > > The output from MTVarConcor when the above program is the input is: > > > > B% 0 1 7(2) > > C 1 2(3) 4 5(2) > > E 1 7(5) > > F 0 2 4(2) > > L 1 8(3) > > OX 2(2) 4 > > OY% 2(2) 4 > > S 1 7(2) > > W 0 1 2 > > X 0 2(4) 4 6 7(2) > > Y 0 2(3) 6(2) > > > > I hope someone will find this program useful. > > Lloyd > >
Re: [M100] Variable Concordance - MTVarConcor
- Original Message - From: "Joshua O'Keefe" To: Sent: Monday, May 01, 2023 8:57 PM Subject: Re: [M100] Variable Concordance - MTVarConcor > On May 1, 2023, at 5:03 PM, Mike Stein wrote: > > It worked fine on the test program; FYI, attached is the program it died on. > I was able to reproduce the crash and ran it through gdb. The last line of your "Eliza.bas" file seems to make line 100 of the code very unhappy. It seems to be an 0x1a character and then a bunch of question marks. If you delete that line of the input file, the program is parsed successfully.= --- Right you are! The EOF problem; I should have looked a little more carefully. Thanks for the tip, and thanks to Lloyd for the program (and Mtlineref) ! m
Re: [M100] Variable Concordance - MTVarConcor
I was curious about that. I could easily modify this utility to deal with a control z.I'll probably post an update to MTVarConcor along with the other two I recently developed (MTLineRef and MTRenum). I'll try to do that before the weekend. Methinks it would be admirable goal for the programs to accept anything that the M100 accepts. Lloyd -Original Message- From: M100 On Behalf Of Bert Put Sent: Tuesday, May 2, 2023 8:16 AM To: m...@bitchin100.com Subject: Re: [M100] Variable Concordance - MTVarConcor On 5/1/23 19:57, Joshua O'Keefe wrote: > The last line of your "Eliza.bas" file seems to make line 100 of the code > very unhappy. > It seems to be an 0x1a character and then a bunch of question marks. > > If you delete that line of the input file, the program is parsed successfully. Ah yes, the good old "Ctl-Z" character to mark the end of the file, followed by a bunch of random characters, to the end of the disk sector. The M-100 knows not to go any further after the Ctl-Z but most file utilities don't know that, so the first thing I have to do to clean up the file is remove that junk and Ctl-Z. Cheers,Bert
Re: [M100] Variable Concordance - MTVarConcor
On 5/1/23 19:57, Joshua O'Keefe wrote: The last line of your "Eliza.bas" file seems to make line 100 of the code very unhappy. It seems to be an 0x1a character and then a bunch of question marks. If you delete that line of the input file, the program is parsed successfully. Ah yes, the good old "Ctl-Z" character to mark the end of the file, followed by a bunch of random characters, to the end of the disk sector. The M-100 knows not to go any further after the Ctl-Z but most file utilities don't know that, so the first thing I have to do to clean up the file is remove that junk and Ctl-Z. Cheers,Bert
Re: [M100] Variable Concordance - MTVarConcor
> On May 1, 2023, at 5:03 PM, Mike Stein wrote: > > It worked fine on the test program; FYI, attached is the program it died on. > I was able to reproduce the crash and ran it through gdb. The last line of your "Eliza.bas" file seems to make line 100 of the code very unhappy. It seems to be an 0x1a character and then a bunch of question marks. If you delete that line of the input file, the program is parsed successfully.
Re: [M100] Variable Concordance - MTVarConcor
Sorry; not much info there ;-) It worked fine on the test program; FYI, attached is the program it died on. m On Mon, May 1, 2023 at 7:33 PM Mike Stein wrote: > Here's what I get (Win7): > > > On Mon, May 1, 2023 at 4:38 PM wrote: > >> Hello all, >> >> >> >> I’ve written a variable concordance program for Windows that will take a >> TRS-80 Model 100 BASIC program and will list the variables in alphabetical >> order with the line numbers where they appear.The name of this program >> is MTVarConcor. The executable, source and a pdf file describing it can >> be found at www.GitHub.com/LEJ-Projects/MTVarConcor. >> >> >> >> As an example, the 10 line program, drop (written by David Plass) is as >> follows: >> >> >> >> 0 >> CLS:POKE-902,PEEK(63795):F=.25+RND(1)/4:W=-.25+RND(1)/2:X=0:Y=1:B%=5+25*RND(1) >> >> >> 1 C=0:PRINT@280+B%,CHR$(27)"Vý"SPACE$(9-E)"ý":PRINT@200 >> ,"S:"S:PRINT"L:"5-L:PRINTUSING"W:#.#";W >> >> 2 C=C+F:PRINT@C," ýý":IFX<>0THENPRINT@OX+40*OY%," >> ":OX=X:OY%=Y:Y=Y+.3:X=X+W:GOTO6 >> >> 4 IFINKEY$=" "THENX=C+2:F=F*2:OX=0:OY%=0 >> >> 5 IFC>=37THENPRINT@37," ":C=0:GOTO2ELSE2 >> >> 6 IFY<7.01THENPRINT@X+40*FIX(Y),"ý":GOTO4 >> >> 7 >> IFX>=B%+1ANDX<=B%+10-ETHENPRINT@97,"Hit!":CALL4811:S=S+10*(E+1):E=E-(E<8):GOTO0 >> >> >> 8 L=L+1:IFL<5THENPRINT@97,"MISS!":CALL4811:GOTO0ELSEPRINT@55,"Game >> over":END >> >> >> >> The output from MTVarConcor when the above program is the input is: >> >> >> >> B% 0 1 7(2) >> >> C 1 2(3) 4 5(2) >> >> E 1 7(5) >> >> F 0 2 4(2) >> >> L 1 8(3) >> >> OX 2(2) 4 >> >> OY% 2(2) 4 >> >> S 1 7(2) >> >> W 0 1 2 >> >> X 0 2(4) 4 6 7(2) >> >> Y 0 2(3) 6(2) >> >> >> >> I hope someone will find this program useful. >> >> Lloyd >> >> >> >> <>
Re: [M100] Variable Concordance - MTVarConcor
> On May 1, 2023, at 3:58 PM, lloydel...@comcast.net wrote: > Not using the output file is odd. I'm delighted to report that this turned out to be an operator error rather than a program error.
Re: [M100] Variable Concordance - MTVarConcor
Here's what I get (Win7): On Mon, May 1, 2023 at 4:38 PM wrote: > Hello all, > > > > I’ve written a variable concordance program for Windows that will take a > TRS-80 Model 100 BASIC program and will list the variables in alphabetical > order with the line numbers where they appear.The name of this program > is MTVarConcor. The executable, source and a pdf file describing it can > be found at www.GitHub.com/LEJ-Projects/MTVarConcor. > > > > As an example, the 10 line program, drop (written by David Plass) is as > follows: > > > > 0 > CLS:POKE-902,PEEK(63795):F=.25+RND(1)/4:W=-.25+RND(1)/2:X=0:Y=1:B%=5+25*RND(1) > > > 1 C=0:PRINT@280+B%,CHR$(27)"Vý"SPACE$(9-E)"ý":PRINT@200 > ,"S:"S:PRINT"L:"5-L:PRINTUSING"W:#.#";W > > 2 C=C+F:PRINT@C," ýý":IFX<>0THENPRINT@OX+40*OY%," > ":OX=X:OY%=Y:Y=Y+.3:X=X+W:GOTO6 > > 4 IFINKEY$=" "THENX=C+2:F=F*2:OX=0:OY%=0 > > 5 IFC>=37THENPRINT@37," ":C=0:GOTO2ELSE2 > > 6 IFY<7.01THENPRINT@X+40*FIX(Y),"ý":GOTO4 > > 7 > IFX>=B%+1ANDX<=B%+10-ETHENPRINT@97,"Hit!":CALL4811:S=S+10*(E+1):E=E-(E<8):GOTO0 > > > 8 L=L+1:IFL<5THENPRINT@97,"MISS!":CALL4811:GOTO0ELSEPRINT@55,"Game > over":END > > > > The output from MTVarConcor when the above program is the input is: > > > > B% 0 1 7(2) > > C 1 2(3) 4 5(2) > > E 1 7(5) > > F 0 2 4(2) > > L 1 8(3) > > OX 2(2) 4 > > OY% 2(2) 4 > > S 1 7(2) > > W 0 1 2 > > X 0 2(4) 4 6 7(2) > > Y 0 2(3) 6(2) > > > > I hope someone will find this program useful. > > Lloyd > > > >
Re: [M100] Variable Concordance - MTVarConcor
Thanks. Many years ago in the early 80s, there were some folks that paid me to write BASIC for the TRS-80 Model II and III. I did most of my writing on my TRS-80 Model I then transferred via cassette to the Model III. (I can’t remember how I moved it to the Model II). I finished the debug at the customer’s facility.Being armed with a variable concordance was essential. (Nothing like trying to fix bugs while your customer is watching over your shoulder).I cannot remember where I had originally obtained the variable concordance. After a halfhearted unsuccessful search for one on the web I decided to craft my own. It was fun. It might not be the most straightforward method, but it seems to work.I’ve tried it on a few larger programs such as Eliza, Murder Mansion, Haunted House as well as a couple I wrote (Star Merchant and Dungeon Warrior). So far, so good. I’m happy to hear it runs on Linux without too much trouble. I should really try and spend more time with Linux. Not using the output file is odd. I’m glad I used both printf and fprintf for the final output so you were able to get the results. Lloyd From: M100 On Behalf Of Joshua O'Keefe Sent: Monday, May 1, 2023 4:45 PM To: m...@bitchin100.com Subject: Re: [M100] Variable Concordance - MTVarConcor Hi Lloyd, I'm happy to report your code compiled without error on a modern Linux system, although I did run into some very minor non-breaking bugs in operation. Currently it ignores the "output file" and emits the tokenization to stdout. After that, it produces output that matches your test output perfectly. Thanks for providing source that made it so easy to run. This can be very useful for program analysis.
Re: [M100] Variable Concordance - MTVarConcor
Hi Lloyd, I'm happy to report your code compiled without error on a modern Linux system, although I did run into some very minor non-breaking bugs in operation. Currently it ignores the "output file" and emits the tokenization to stdout. After that, it produces output that matches your test output perfectly. Thanks for providing source that made it so easy to run. This can be very useful for program analysis.