Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 23:46 05 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: V5.05.06RC19: Scotty more power

     Page 3 of 4    
Author Message
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1421
Posted: 09:05pm 15 Nov 2020
Copy link to clipboard 
Print this post

thinBasic, RobotBASIC, QB64 all return var as the true/false result of the test. PUREBASIC complains about syntax.
Micromites and Maximites! - Beginning Maximite
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5914
Posted: 09:18pm 15 Nov 2020
Copy link to clipboard 
Print this post

  CircuitGizmos said  thinBasic, RobotBASIC, QB64 all return var as the true/false result of the test. PUREBASIC complains about syntax.


In PUREBASIC you need bool()

b=7
c=7
a=Bool(b=c)
Debug a


It forces you to be clear about what yu are doing...
VK7JH
MMedit   MMBasic Help
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3018
Posted: 09:19pm 15 Nov 2020
Copy link to clipboard 
Print this post

FWIW:

DOS MMBasic Ver 5.05.02
Copyright 2011-2019 Geoff Graham

> a=1: b=2: c=a=b: print a,b,c
1       2       0
> b=1: c=a=b: print a,b,c
1       1       1
> a=0: c=a=b: print a,b,c
0       1       0
> a=2: c=a=b: print a,b,c
2       1       0
> b=2: c=a=b: print a,b,c
2       2       1
>

~
Edited 2020-11-16 07:24 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1421
Posted: 10:25pm 15 Nov 2020
Copy link to clipboard 
Print this post

  TassyJim said  
  CircuitGizmos said  thinBasic, RobotBASIC, QB64 all return var as the true/false result of the test. PUREBASIC complains about syntax.


In PUREBASIC you need bool()

b=7
c=7
a=Bool(b=c)
Debug a


It forces you to be clear about what yu are doing...


Nice! Thank you.
Micromites and Maximites! - Beginning Maximite
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1098
Posted: 11:31pm 15 Nov 2020
Copy link to clipboard 
Print this post

From Mr. Scott,

if speed is important Captain, then
c = a = b  is fastest,
c = (a = b) is about 10% slower, and
if/then constructs are slower still!

.... but I do think that the a = b = c construct is not intuitively obvious, particularly to a newcomer to programming languages.

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3018
Posted: 12:17am 16 Nov 2020
Copy link to clipboard 
Print this post

Further FWIW, MM2 MUP V3
> ?mm.ver
5.041
> dim integer a,b,c
> a=1: b=2: c=a=b: print a,b,c
1       2       0
>  b=1: c=a=b: print a,b,c
1       1       1
>  a=0: c=a=b: print a,b,c
0       1       0
>  b=2: c=a=b: print a,b,c
0       2       0
>

And Armmite F4:
ARMmite MMBasic Version 5.05.08
Copyright 2011-2019 Geoff Graham
Copyright 2016-2019 Peter Mather

> dim integer a,b,c
> a=1: b=2: c=a=b: print a,b,c
1       2       0
> b=1: c=a=b: print a,b,c
1       1       1
> a=0: c=a=b: print a,b,c
0       1       0
> b=2: c=a=b: print a,b,c
0       2       0
> a=2: c=a=b: print a,b,c
2       2       1
>

I agree that this is not a BASIC construction that I would ever have thought to use, and knowing about it, for the sake of clarity I would not use it. But that's a personal preference.
Edited 2020-11-16 10:19 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 05:16pm 16 Nov 2020
Copy link to clipboard 
Print this post

V5.05.06RC20 posted

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Fixes bug when a program contains duplicate function names - now you will get the error message but the program won't be loaded so the message won't re-occur allowing you to edit the program to fix the bug

Fixed bug in calling string functions with a calculated string. This bug was introduced to try and improve the depth to which recursion could take place before the stack is used up but it was an "optimisation" too far.

Fixed typo in the RGB332 mapping table for blue

Changed MM.INFO(FILESIZE name$) to return -2 when the "name$" refers to a directory. This allows you to distinguish between a missing file and a directory.

Added CAT as a synonym for INC to make use with strings more obvious
e.g. CAT string1$, string2$ 'appends string2$ to string1$

Attempting to use a location in an array in MATH commands and functions that require an array as a parameter will now give an error.

Trying to use the same array for the output of MATH M_MULT or MATH V_MULT as one of the inputs now gives an error

Fixes a bug in the triangle drawing routine when the coordinates are co-linear and not ordered

A FILL of -1 no longer causes the TRIANGLE sub to give an error - code now matches the manual

Major rewrite of graphics primitives for BLIT to give significant performance improvement
Edited 2020-11-17 03:17 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3850
Posted: 06:50pm 16 Nov 2020
Copy link to clipboard 
Print this post

Thanks Peter my tools are working again and my unit-tests passing

The enhancement to MM.INFO(FILESIZE name$) is also appreciated.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1133
Posted: 07:24pm 16 Nov 2020
Copy link to clipboard 
Print this post

Hi Peter,

thanks for your efforts!
The editor (colour coded syntax) does not recognize INC, CAT or MMDEBUG. Is that intentional?
It seems someone has changed the restrictions on the maximum number of commands (now 132).

Regards
Michael
Edited 2020-11-17 06:02 by twofingers
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 07:53pm 16 Nov 2020
Copy link to clipboard 
Print this post

  Quote  The editor does not recognize INC or CAT. Is that intentional?

Forgot to add them - will be in next version
  Quote  It seems someone has changed the restrictions on the maximum number of commands (now 132).

No, just some behind the scenes magic
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3850
Posted: 08:18pm 16 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  
  Quote  It seems someone has changed the restrictions on the maximum number of commands (now 132).

No, just some behind the scenes magic


As I understand it, if commands are synonyms of each other e.g. COLOUR and COLOR or INC and CAT they only require one command/token/slot.

Tom
Edited 2020-11-17 06:18 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1133
Posted: 08:25pm 16 Nov 2020
Copy link to clipboard 
Print this post

  thwill said  
  matherp said  As I understand it, if commands are synonyms of each other e.g. COLOUR and COLOR or INC and CAT they only require one command/token/slot.

I doubt it, but peter will explain ... someday.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3850
Posted: 08:28pm 16 Nov 2020
Copy link to clipboard 
Print this post

  twofingers said  
  thwill said  As I understand it, if commands are synonyms of each other e.g. COLOUR and COLOR or INC and CAT they only require one command/token/slot.

I doubt it, but peter will explain ... someday.


Suit yourself, it's not magic, plus he kindly told me how it was done in a PM Strictly speaking (again as I understood the explanation) he is pre-processing the source to handle the synonyms when it is loaded into the flash.

Tom
Edited 2020-11-17 06:29 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 08:28pm 16 Nov 2020
Copy link to clipboard 
Print this post

RC20,
LOCAL STRING dt = MM.INFO$(MODIFIED f)

not work, complaining about string needed (but f is also string, in RC19 works OK)... In command line somehow works
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3558
Posted: 08:49pm 16 Nov 2020
Copy link to clipboard 
Print this post

@matherp

Are these performance improvements achievable for other platforms (MM2, MM+, ARMmite) possible ?
PicomiteVGA PETSCII ROBOTS
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5914
Posted: 09:34pm 16 Nov 2020
Copy link to clipboard 
Print this post

  jirsoft said  RC20,
LOCAL STRING dt = MM.INFO$(MODIFIED f)

not work, complaining about string needed (but f is also string, in RC19 works OK)... In command line somehow works


Your problem is caused when you try to get the time of a directory.
It works as expected with files. but now returns a number with directories.

OPTION EXPLICIT
OPTION DEFAULT NONE

print NCdateTime("fm.bas") ' works as expected
print NCdateTime("test") ' test is a directory - gives an error

FUNCTION NCdateTime(f as string) AS STRING
 'prepare date and time of file
 
LOCAL STRING dt = MM.INFO$(MODIFIED f)
 IF dt<>"" THEN dt = MID$(dt, 3, 14)
 NCdateTime = dt
END FUNCTION


Nice program by the way.

Jim
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 10:59pm 16 Nov 2020
Copy link to clipboard 
Print this post

  Quote  Your problem is caused when you try to get the time of a directory.
It works as expected with files. but now returns a number with directories.


It used to return a blank string with directories but actually there is no reason it can't return a valid modified date so I'll make it do this in the next release
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 11:16pm 16 Nov 2020
Copy link to clipboard 
Print this post

Thanks Peter,
I already sought for reason, why dirs have no time of change...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 04:27am 17 Nov 2020
Copy link to clipboard 
Print this post

  Turbo46 said  Please, please, please release it! Plus one.

I'd love to have an up-to-date printed manual.

For info this INC or += suggestion came up for MMBasic before and was rejected. I'm glad it finally made it.

I'd love to know which (if any) of these improvements Peter has made will make it to MMBasic for the Original Maximites and the Micromites.

Thank you Peter and Geoff.

Bill


Please, please, please release it! Plus two.

I also would like to have an up-to-date printed manual.
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 446
Posted: 05:03am 17 Nov 2020
Copy link to clipboard 
Print this post

  bar1010 said  
  Turbo46 said  Please, please, please release it! Plus one.

I'd love to have an up-to-date printed manual.

For info this INC or += suggestion came up for MMBasic before and was rejected. I'm glad it finally made it.

I'd love to know which (if any) of these improvements Peter has made will make it to MMBasic for the Original Maximites and the Micromites.

Thank you Peter and Geoff.

Bill


Please, please, please release it! Plus two.

I also would like to have an up-to-date printed manual.


Peter still working on the new version, adding new features and fixing bugs.
I like the Linux Mint release process and it can be applied here...

When will it be released? When ready  
 
     Page 3 of 4    
Print this page
© JAQ Software 2024