Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:09 02 Aug 2025 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 : Number to string

     Page 2 of 2    
Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:33pm 02 Nov 2018
Copy link to clipboard 
Print this post

Paul,
Jeff is using the original Maximite and it's MMBasic doesn't know about integers. Floating point and strings only.

Jim

VK7JH
MMedit
 
jeffj
Regular Member

Joined: 04/02/2012
Location: Australia
Posts: 84
Posted: 01:06am 03 Nov 2018
Copy link to clipboard 
Print this post

Hi Paul and Jim
thanks for yr help really appreciated
I thought it was a simple question.I didn't think about using an array.
My solution as foll.
Thanks for the education on % etc Paul.
Jim You probably know off hand why my version of MM does not recognise the "LOCAL" command. Do I need to go to ver 4.5C ?
regards Jeff








'THIS WORKS
dim var$(3),AL(10)
al(2)=1'test value
al(3)=1'test value
data "A","B","C"
for loop= 1 to 3
read var$(loop)
next loop
for loop= 1 to 3
if al(loop)=1 then print var$(loop)
next loop
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:14am 03 Nov 2018
Copy link to clipboard 
Print this post

  jeffj said  
Jim You probably know off hand why my version of MM does not recognise the "LOCAL" command. Do I need to go to ver 4.5C ?

LOCAL was around before V4.5 so it should work for you.

I am not sure exactly what you are trying to achieve but this is what I came up with as a solution to my interpretation of your original brief

  Quote   ' set up the message bank as a global array during program initialisation
DIM messages$(10)
messages$(
1) = "Battery"
messages$(
2) = "AC fail"
messages$(
3) = "Over Temperature"
messages$(
4) = "Too cold"
messages$(
5) = "Lost contacct"
messages$(
6) = "Contact restored"
messages$(
7) = "Spare"
messages$(
8) = "Spare"
messages$(
9) = "Spare"
messages$(
10) = "No Idea at all!!!"
'
'do stuff

FOR n = 1 TO 10
' simple message printing
PRINT messages$(n)
' or
errorMessage$= messages$(n)
PRINT errorMessage$
NEXT n
END


No subroutine needed.
Jim
VK7JH
MMedit
 
jeffj
Regular Member

Joined: 04/02/2012
Location: Australia
Posts: 84
Posted: 07:29am 03 Nov 2018
Copy link to clipboard 
Print this post

Spot on Jim
Why couldn't I have thought of that
I use yr editing program all the time now .many thanks for the work you put into that
Thanks again
Jeff
 
     Page 2 of 2    
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025