Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:26 01 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 : dim statements in mmbasic 4.5

Author Message
Troyfa
Newbie

Joined: 23/01/2016
Location: Australia
Posts: 9
Posted: 03:54pm 23 Jan 2016
Copy link to clipboard 
Print this post

Im new to these forums.. I bought a minimite kit from Jaycar.. it uses the 695F512 chip, which was pre programmed by silicon chip magazine... and had MMBasic 2.7b on it...

The minimite, is just amazing... I'm really impressed with it.. I hooked it up to a few 7 segments displays and displayed stuff on them..

I use Linux on my computer, and I have been reading these forums to work out which software to use to update the firmware on the pics.. yeah there are a few Linux users here on the forums

I updated MMBasic to version 4.5 for the Maximite/Minimite using mphidflash.. after the update I have noticed that the DIM statements aren't working for some reason..

heres a screen shot...



10 dim text( 4 ) = ( 1, 2, 3, 4 )
20 print text( 1 )

run
0


 
Troyfa
Newbie

Joined: 23/01/2016
Location: Australia
Posts: 9
Posted: 03:56pm 23 Jan 2016
Copy link to clipboard 
Print this post

Hey I just noticed MMBasic is written twice...
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 04:11pm 23 Jan 2016
Copy link to clipboard 
Print this post

Hi and welcome to the forums and MMBasic
V4.5 does not allow you to assign values to arrays when DIMing them

DIM TXT( 4 )
FOR n = 1 TO 4
txt(n) = n
NEXT n

PRINT TXT( 1 )


TEXT is not a keyword in V4.5 but is used in later versions for the micromite.
It would be safer to refrain from using TEXT as a variable name (but does not cause problems for now)

You can forget about using line numbers. They still work in V4.5 but it is better to learn to leave them alone, the sooner the better.

Seeing a double signon is not a problem, just a quirk of Linux and the USB-serial initialization. Windows users see that sometimes too.

Jim

VK7JH
MMedit   MMBasic Help
 
Troyfa
Newbie

Joined: 23/01/2016
Location: Australia
Posts: 9
Posted: 04:19pm 23 Jan 2016
Copy link to clipboard 
Print this post

I forgot to mention that when I edit code inside the built in editor.. it cannot save..

I press the F1 key, and it says... Do you want to discard changes (Y/N)...

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 05:10pm 23 Jan 2016
Copy link to clipboard 
Print this post

I think minicom does things to the function keys.
You can use other control keys instead.

From the MMBasic manual:
  Quote  You can also use control keys instead of the functions keys listed above. These control keystrokes are:
LEFT Ctrl-S RIGHT Ctrl-D UP Ctrl-E DOWN Ctrl-X
HOME Ctrl-U END Ctrl-K PageUp Ctrl-P PageDn Ctrl-L
DEL Ctrl-] INSERT Ctrl-N F1 Ctrl-Q F2 Ctrl-W
F3 Ctrl-R ShiftF3 Ctrl-G F4 Ctrl-T F5 Ctrl-Y


Jim
VK7JH
MMedit   MMBasic Help
 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 06:22pm 23 Jan 2016
Copy link to clipboard 
Print this post

I found that PuTTY is the only Terminal program on Ubuntu that will properly deal with the function keys. It will also display colour for Option Colour On in the later MM versions.

If you need any help setting up PuTTY just ask.

Anthony.
 
Troyfa
Newbie

Joined: 23/01/2016
Location: Australia
Posts: 9
Posted: 05:44pm 24 Jan 2016
Copy link to clipboard 
Print this post

  TassyJim said   Hi and welcome to the forums and MMBasic
V4.5 does not allow you to assign values to arrays when DIMing them

DIM TXT( 4 )
FOR n = 1 TO 4
txt(n) = n
NEXT n

PRINT TXT( 1 )


TEXT is not a keyword in V4.5 but is used in later versions for the micromite.
It would be safer to refrain from using TEXT as a variable name (but does not cause problems for now)

You can forget about using line numbers. They still work in V4.5 but it is better to learn to leave them alone, the sooner the better.

Seeing a double signon is not a problem, just a quirk of Linux and the USB-serial initialization. Windows users see that sometimes too.

Jim


Thanks for that Jim.. yeah, that code works

I also found some code that is quite interesting...

dim txt( 4 )
data 10, 20, 33, 62
for n = 1 to 4
read txt( n )
next n


Thanks for the tip about the line numbers... and the keys.. i will give them a try...

thanks ajkw.. does it work in Linux?

 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024