Mintoris Forum

Author Topic: Having Problems?  (Read 10536 times)

Mintoris

  • Administrator
  • Full Member
  • *****
  • Posts: 57
Having Problems?
« on: Nov 17, 2010, 05:39 AM »
Are you having problems with Mintoris Basic?  Having trouble getting something to work? Post your problem here where others can help you out.

RobertG

  • Full Member
  • ***
  • Posts: 10
Re: Having Problems?
« Reply #1 on: Jan 15, 2011, 05:41 AM »
I'm relatively new to programming, so my apologies for posting (most likely extremely) simple problems. I decided to start off with a calculator, but running into a small problem.


Main: 
print "Calculator"
input "Enter your math command.", a3$
if  a3$ = m1, goto Multiplication
end

Multiplication:
input "Enter the first number." , nm1x
input "Enter the second number." , nm2x
print "Your product is," ; nm1x * nm2x
end



Gives me "Type mismatch. This type of variable is not appropriate here."

I'm sure it's an easy fix. Comments?

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #2 on: Jan 15, 2011, 05:47 AM »
instead of:

if  a3$ = m1, goto Multiplication

you want something like:

if a3$ = "m1" then Multiplication

Note the quotes around "m1". Strings like that always need to be in quotes and it's If…Then not If…Goto (no commas)

Look over the demo program on the P9 button and copy some of the things in there.

Keep asking questions, I'm always happy to answer.

RobertG

  • Full Member
  • ***
  • Posts: 10
Re: Having Problems?
« Reply #3 on: Jan 15, 2011, 06:42 AM »
Thanks Chuck‼

lancegary

  • Full Member
  • ***
  • Posts: 24
Re: Having Problems?
« Reply #4 on: Jan 15, 2011, 08:29 AM »
I'm relatively new to programming, so my apologies for posting (most likely extremely) simple problems. I decided to start off with a calculator, but running into a small problem.


Main: 
print "Calculator"
input "Enter your math command.", a3$
if  a3$ = m1, goto Multiplication
end

Multiplication:
input "Enter the first number." , nm1x
input "Enter the second number." , nm2x
print "Your product is," ; nm1x * nm2x
end



Gives me "Type mismatch. This type of variable is not appropriate here."

I'm sure it's an easy fix. Comments?

Check the line "if a3$=m1 then " since m1 is a numerical variable. Perhaps you meant to put the m1 in inverted commas?

Lance

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #5 on: Jan 15, 2011, 11:46 PM »
I'm relatively new to programming, so my apologies for posting (most likely extremely) simple problems. I decided to start off with a calculator, but running into a small problem.


Main: 
print "Calculator"
input "Enter your math command.", a3$
if  a3$ = m1, goto Multiplication
end

Multiplication:
input "Enter the first number." , nm1x
input "Enter the second number." , nm2x
print "Your product is," ; nm1x * nm2x
end



Gives me "Type mismatch. This type of variable is not appropriate here."

I'm sure it's an easy fix. Comments?

Check the line "if a3$=m1 then " since m1 is a numerical variable. Perhaps you meant to put the m1 in inverted commas?

Lance

Lance, Sorry, but I am not sure what you are trying to do.  Maybe if you tell me what you would input and what you expect to happen.

RobertG

  • Full Member
  • ***
  • Posts: 10
Re: Having Problems?
« Reply #6 on: Feb 04, 2011, 01:53 AM »
wait 400
print "Bearing…"
wait 450
print "Calculating‥"
wait 600
print "Retrieving‥"
GPS On
CLS
print "Retrieving…"
bearing1 = GetGPSBearing
print bearing1$
print "Bearing found."
gl1 = GetLatitude()
gl2 = GetLongitude()
print "Latitude,", gl1
wait 300
print "Longitude,", gl2
wait 350
if bearing1$ = "0" then failbearing


failbearing:
CLS
print "Bearing error."
wait 500
print "GPS bearing could not be located."
wait 490
print "Latitude,", gl1
wait 540
print "Longitude,", gl2
wait 3000
st1 = 0
if gl1 <> 0 then st1 + 33
if gl2 <> 0 then st1 + 33
if bearing1$ <> 0 then st1 + 33
if st1 = 99 then status 100percent
if st1 = 66 then 66percent
if st1 = 33 then 33percent


g100percent:
print "GPS was completely successful."

g66percent:
print "GPS missed one function."

g33percent:
print "GPS is 100 percent down."

I got GPS to work,but when I run this at the end it prints all the last 3 statements. I want it to print only one depending on the programs success. Comments? Thanks.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #7 on: Feb 04, 2011, 02:40 AM »
Robert, in your example you use several line labels.

X = 10
if X > 5 then thisline

thisline:
Print "Hello world"

In this example, if X is greater than 5 then the program would jump to thisline and print "Hello world".  But even if X were less than 5 the program would continue on past thisline and still execute the print statement.  There is nothing about a line label by itself that stop things from being executed.  You might want to use a Sub.

X = 10
if X > 5 then Test()

Sub Test()
  Print "Hello world"
End Sub

In this example, if X > 5 then the subroutine Test() will be executed.  Statements inside a Sub … End Sub are just skipped when execution gets to them without being called.

RobertG

  • Full Member
  • ***
  • Posts: 10
Re: Having Problems?
« Reply #8 on: Feb 07, 2011, 11:41 PM »
This program doesn't display the beginning text….

main1:
Graphics On
Sensors On
color 0,0,100
TextAlign 0
TextColor 0,30,100
TextSize 45
print "Guessing Game .5"
wait 3000
goto guess1
guess1:
TextAlign -1
TextSize 20
TextColor 48,30,60
print "Guess the number with 1 guess and you win."
CLS
rn = Rnd(13)
input "What is your guess?", g1
if g1 = rn then win
if g1 <> rn then guess1

win:
TextSize 100
TextColor 40,2,100
print "WIN"
vibrate 200
vibrate 100
wait 750
CLS
input "Would you like to try again?", wyltta1$
if wyltta1$ = "yes" then win
if wyltta1$ = "no" then end


end:
print "END"

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #9 on: Feb 08, 2011, 04:28 AM »
Robert, use the DrawText command instead of the Print command when Graphics mode is on.

Oh and I believe that the Input command automatically shuts off Graphics mode.
« Last Edit: Feb 08, 2011, 04:30 AM by Chuck »

gertbokkers

  • Newbie
  • *
  • Posts: 1
Re: Having Problems?
« Reply #10 on: Jan 20, 2012, 10:30 PM »
The edit command shows 1,234 in the editfield for an european system instead of 1.234, pressing ok deliver value 0. The input of an editfield should accept the european notation if it use that notation for outpuf.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #11 on: Jan 21, 2012, 12:25 AM »
The edit command shows 1,234 in the editfield for an european system instead of 1.234, pressing ok deliver value 0. The input of an editfield should accept the european notation if it use that notation for outpuf.


Hmm, I'll look into that.

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #12 on: Jan 21, 2012, 03:48 AM »
The problem inputting and converting numbers with decimal commas has been fixed in the newest release 4.2.6

Thanks for reporting the problem and please let me know if you have any problems in the future.

-Chuck

Bitrate

  • Jr. Member
  • **
  • Posts: 5
Re: Having Problems?
« Reply #13 on: Jan 31, 2012, 06:39 PM »
Are you having problems with Mintoris Basic?  Having trouble getting something to work? Post your problem here where others can help you out.

I am having problems to create Icons for my programs. Can I personalize them?

Bitrate

  • Jr. Member
  • **
  • Posts: 5
Re: Having Problems?
« Reply #14 on: Jan 31, 2012, 07:35 PM »
My application opens my garaje door using a $16 BT to USART card but I would like to call my program "garaje.bas" and show a car shaped Icon in the screen.
How could get this ?

Bitrate

  • Jr. Member
  • **
  • Posts: 5
Re: Having Problems?
« Reply #15 on: Jan 31, 2012, 09:52 PM »
So far the only way for me to call a program is to paste it in anyone of the P0.bas to P9.bas and push the bottom.
How should I do if the program's name is MyProgram.bas? and I don't wish to change the name to Pn.bas? ::)

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #16 on: Feb 01, 2012, 01:46 AM »
To create a new program with your own name, press Menu then New from the main console screen.  This will create a blank program that you can start coding in or that you can paste a program into.

You can also mount your device, go to the Mintoris.Basic folder and rename any program.

Hope this helps.

-Chuck

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: Having Problems?
« Reply #17 on: Mar 29, 2012, 06:29 AM »
Sorry Bitrate, I missed your question.  Currently you can only use the stock icon for shortcuts.

-Chuck