Re: [M100] Variable Concordance - MTVarConcor

2023-05-02 Thread MikeS


- 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

2023-05-02 Thread lloydelmer
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

2023-05-02 Thread Bert Put

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

2023-05-01 Thread Joshua O'Keefe
> 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

2023-05-01 Thread Mike Stein
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

2023-05-01 Thread Joshua O'Keefe
> 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

2023-05-01 Thread Mike Stein
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

2023-05-01 Thread lloydelmer
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

2023-05-01 Thread Joshua O'Keefe
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.

[M100] Variable Concordance - MTVarConcor

2023-05-01 Thread lloydelmer
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