Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:22 28 Nov 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 : MMBasic for Windows - betas

     Page 19 of 30    
Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 12:52am 23 Apr 2023
Copy link to clipboard 
Print this post

Thank you Doug, great job! Without a manual all of Peter's great work was just a novelty for me.

One thing, in the acknowledgements section there should be reference to the One Lone Coder and the olcPixelGameEngine. https://github.com/OneLoneCoder

Regarding the passing by value or reference issue, it's always seemed a bit 'muddy' to me and perhaps Tom would like a more clear explanation. Not that it is an issue for MMB4W only of course.

Bill
Keep safe. Live long and prosper.
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 01:02am 23 Apr 2023
Copy link to clipboard 
Print this post

  Turbo46 said  
One thing, in the acknowledgements section there should be reference to the One Lone Coder and the olcPixelGameEngine. https://github.com/OneLoneCoder
Bill

Thanks Bill, done.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 339
Posted: 02:07am 23 Apr 2023
Copy link to clipboard 
Print this post

  panky said  
  toml_12953 said  
On page 28 you mention passing by reference. Maybe you could also show passing by value. All you have to do is include the argument in parentheses like so:

a=4: b=4
testsub((a),b)
print a,b
sub testsub(x,y)
x=x+1: y=y+1
end sub

4     5

Thanks Tom, I understand what is happening but am unsure as to where you might use this and why? Can you expand a little?
Regards,
Doug.


That way you could avoid having local variables in a subprogram. It keeps your subprogram more encapsulated and avoids unwanted side effects. It frees you to use the parameter names as variables in your routines and eliminates conflicts with the variables in any other routines.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 03:36am 23 Apr 2023
Copy link to clipboard 
Print this post

A better way to describe the passing of parameters might be:
  Quote  
Variables are passed by reference and their value (as seen in the main program) can be changed within the subroutine. This is often desirable but can also cause unexpected outcomes.
When the parameter being passed is an expression, the result of that expression is passed as a value.
The expression could be the result of simple maths or the return value of a function. It can also be as simple as enclosing a variable in brackets, causing the interpreter to treat it as an expression.


A few examples should follow.

Jim
VK7JH
MMedit   MMBasic Help
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 03:47am 23 Apr 2023
Copy link to clipboard 
Print this post

GDay Lads,

Great work All involved.

Now, I might be wrong but shouldn't the term Passing actually be PARSING?

Kind Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 04:33am 23 Apr 2023
Copy link to clipboard 
Print this post

Thanks Jim - noted.

Mick 'passing' here refers to the action of sending (that is, passing) a value or expressing to a subroutine.
The subroutine 'parses' the arguments sent to it in order to carry out some further actions.
Regards,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 06:07am 23 Apr 2023
Copy link to clipboard 
Print this post

Hi Doug, All,

Fair enough, I feel that Parsing is `interpreting' the data being sent so if you are inferring just `handing it over' then Passing is probably the correct term.

In all honesty I have only had a vague glance at the manual as my finger is in too many pies at the moment so I didn't get the context of where it was used.

My sincerest apologies, but no criticism was meant.

Mick (The BIG one)
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 06:36am 23 Apr 2023
Copy link to clipboard 
Print this post

No probs Mick, good to hear from - hope you are well. I get down to Melbourne from Bega several times a year - will try and catch up for a coffee.
Cheers,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 06:58am 23 Apr 2023
Copy link to clipboard 
Print this post

Hi Doug, All,

You would be most welcome (as would any shedders passing by) to pop in for a coffee/beer/scotch/gin/glass of water.

Just PM me when you are free and in the area.

I am well, been getting out on the golf course a bit, to learn a few more swear words. I am working on a few projects with AndrewG and Twill (different projects) as well as playing a few PC games to while away the time.

Did I tell you retirement is HELL?

Take care all

Regards,

Mick
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 07:18am 23 Apr 2023
Copy link to clipboard 
Print this post

  Quote  Did I tell you retirement is HELL?


Oh, indeed, it's a hard life for us ...

:)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
electricat

Senior Member

Joined: 30/11/2020
Location: Lithuania
Posts: 161
Posted: 11:17pm 23 Apr 2023
Copy link to clipboard 
Print this post

Panky,
That part about "PIN Security" in draft manual seems to be maximite specific.
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 339
Posted: 11:33pm 23 Apr 2023
Copy link to clipboard 
Print this post

Is this a bug in MMBW 5.07.03b15?

When OPTION Y_AXIS UP is in effect, PRINT does nothing.

option y_axis up
print"Won't see this"
option y_axis down
print"This is OK"
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 12:18am 24 Apr 2023
Copy link to clipboard 
Print this post

  electricat said  Panky,
That part about "PIN Security....

It does not throw an error when used but also does nothing so have removed from the manual, thanks.

  toml_12953 said  Is this a bug in MMBW 5.07.03b15?

When OPTION Y_AXIS UP is in effect, PRINT does nothing.

option y_axis up
print"Won't see this"
option y_axis down
print"This is OK"

Tom,
Not sure on b15 but on b16, works as it should with the following options
> option list
OPTION Default mode 9 1024x768
OPTION Default Font 2,1
OPTION Default path C:\MMB4W\work\
OPTION Keyboard US
Current display 38,85
>
Regards,Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 897
Posted: 02:44am 24 Apr 2023
Copy link to clipboard 
Print this post

Hi Doug,
MMB4W Manual feed Back.

Page 18 The Console Window
I think the description is currently for the CMM2. I have not used it before but after playing a bit I think the text below is OK.
Essentially
OPTION CONSOLE SAVE is gone.
CONSOLE string$ is a command that is the same as PRINT but outputs to the console.

  New Text said  
The Console Window

MMBasic for Windows is started via a terminal window called the ‘Command Line Console’. Once started, MMBasic then  
opens its own MMBasic window (graphics window) to which all output is now directed.

For debugging purposes, the ‘Command Line Console’ window referred to above can have output from the main MMBasic window echoed to it. One significant advantage is that the ‘Command Line Console’ window is a ‘scrolling’ window thus you can scroll backwards and forwards to analyse any error messages.

The ‘Command Line Console’ window is not enabled for output by default, however it must NOT be closed – doing so will also close the main MMBasic window!

OPTION CONSOLE SCREEN is the default option and does not echo text to the '‘Command Line Console’
OPTION CONSOLE BOTH will echo text to both the ‘Command Line Console’ and the main graphics window.
OPTION CONSOLE SERIAL (only available within a program) will output text to the ‘Command Line Console’, but suppress text going to the main graphics window. This is usefully when developing/debugging graphics applications. When a program ends the OPTION CONSOLE setting reverts to its previous value.

The output of graphics commands will always go to the main graphics window and are never sent to the ‘Command Line Console’.
The CONSOLE command can also be used to send text to the ‘Command Line Console’  regardless of the setting of OPTION CONSOLE. The CONSOLE command is the same as a PRINT command, but goes to the ‘Command Line Console’. e.g. CONSOLE "Hello World"




  Revised OPTION Descriptions said  

OPTION CONSOLE [SCREEN|SERIAL|BOTH]
There are two possible destinations for MMBasic output. The main MMBasic window which acts as the console and can display text and graphics and, the MMBasic Command Line Console (the window you get when starting MMBasic initially. i.e. CLC). You cannot connect a VT100 terminal via a serial port as for other MMBasic implementations.

OPTION CONSOLE SCREEN is the default value and will direct all output (both GUI and text) to the open MMBasic window whether in command line mode or running a program.

OPTION CONSOLE SERIAL will disable text output to the main MMBasic window. All text will be redirected to the Command Line Console window. This is useful for debugging graphics applications as diagnostic PRINT statements will not corrupt the screen display.This can be only enabled in a program and is reverted to the previous value when the program ends.
Note: This has NOTHING to do with any serial ports.

OPTION CONSOLE BOTH will enable both the Command Line Console window and the main MMBasic window for output of text.input/output.
A big advantage to enabling the command line console window is that it is ‘scrollable’ thus enabling viewing of past commands/error msgs.

OPTION CRLF mode is not valid for MMB4W




Not sure if these are in there already but are useful info.
Cutting and Pasting.
You can paste into autosave using ctrl-V
You can also paste into the editor but only a single line will be accepted

CNTRL+SHIFT+x will close both the main MMbasic window and the command line console window. Handy if you want to reload from MMEdit which required MMB4W to be closed down.

COMMANDS
-add command CONSOLE
CONSOLE string$   This is the same as print but puts output to the console window - perfect for debugging

-serial ports
INV not implemented
RS485 not implemented i.e. remove references to DEN and DEP
Stop Bits 1.5 supported. (S1P5)
The OPEN command and Appendix A should be updated.

It is possible to send a break. Maybe a separate entry in PRINT command or in APPENDIX A

PRINT #1 ,BREAK

MODE command can take -ve mode value
Mode command - use a negative value for the mode and you will get fullscreen with no border e.g.
MODE -16 will fill a 1080p monitor perfectly
Full screen with no border at the top.


FUNCTIONS
-missing function
COMPORT(portno) return 0 is port does not exist, 1 if exists.


FULL Screen Editor.
- new functionality available.
Home - Double press of Home in editor to move to start of the file
End -  Double press of End in editor to move to end of the file

Regards
Gerry
Latest F4 Latest H7
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 339
Posted: 02:48am 24 Apr 2023
Copy link to clipboard 
Print this post

  panky said  
  electricat said  Panky,
That part about "PIN Security....

It does not throw an error when used but also does nothing so have removed from the manual, thanks.

  toml_12953 said  Is this a bug in MMBW 5.07.03b15?

When OPTION Y_AXIS UP is in effect, PRINT does nothing.

option y_axis up
print"Won't see this"
option y_axis down
print"This is OK"

Tom,
Not sure on b15 but on b16, works as it should with the following options
> option list
OPTION Default mode 9 1024x768
OPTION Default Font 2,1
OPTION Default path C:\MMB4W\work\
OPTION Keyboard US
Current display 38,85
>
Regards,Doug.


OK, I found b16 but I still get no printing while OPTION Y_AXIS UP is in effect. I used the same options as in your list to test it.
Edited 2023-04-24 13:05 by toml_12953
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 897
Posted: 03:03am 24 Apr 2023
Copy link to clipboard 
Print this post

Beta16 is here

Remote logging using MMB4W and the WebMite
Latest F4 Latest H7
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 03:39am 24 Apr 2023
Copy link to clipboard 
Print this post

@toml_12953

Not sure what is going on mate - works for me on both Win 11 laptop and Linux Mint 20.1 under wine to a large screen monitor.
Anyone else seeing this? Any ideas for Tom?
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 339
Posted: 04:09am 24 Apr 2023
Copy link to clipboard 
Print this post

  panky said  @toml_12953

Not sure what is going on mate - works for me on both Win 11 laptop and Linux Mint 20.1 under wine to a large screen monitor.
Anyone else seeing this? Any ideas for Tom?


I only see the second line. I should see both.

You see this? This is what it should look like:

Won't see this
This is OK
Edited 2023-04-24 14:10 by toml_12953
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1101
Posted: 04:36am 24 Apr 2023
Copy link to clipboard 
Print this post


Tom,

I think I see what the problem may be.

If you add CLS as the first line of your program above, the bottom line does not print. If you then add a PRINT command on line 2, right after the CLS it prints as it should.

It appears that CLS does something wierd?

At the prompt enter CLS:RUN - the problem is there,
enter just RUN, everything works (on both my Windows and Linux machines).

This might be one for Peter unless I am missing something obvious (ALWAYS possible ).
D.
Edited 2023-04-24 14:40 by panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 897
Posted: 04:48am 24 Apr 2023
Copy link to clipboard 
Print this post

{QUOTE]
When OPTION Y_AXIS UP is in effect, PRINT does nothing.


It works OK for me. Note that the "You wont see this" is at the bottom of the screen.
Try MODE 1 for an 800*600 screen to ensure that its not just that your last line is not visible. Check your have not scaled the font above 100% in windows settings if the bottom line is not visible.
Latest F4 Latest H7
 
     Page 19 of 30    
Print this page
© JAQ Software 2024