Jump to content



Photo
- - - - -

Syn Error


  • Please log in to reply
17 replies to this topic

#1 shadows_cl

shadows_cl

    Newbie

  • Members
  • Pip
  • 9 posts

  • Calculators:
    cfx-9850gb plus

Posted 05 September 2004 - 10:11 AM

My code is

"insert a charge"
?->Q
If Q = "0" Then "0 is not a valid number"

what?s i have bad in mi sample code?

#2 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking & Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool & Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 05 September 2004 - 10:18 AM

you have used the If <-> Then <-> Else <-IfEnd slightly wrong, thats all :)

here is the working version:

"insert a charge"
?->Q
If Q = "0"
Then "0 is not a valid number"

see? nothing majorly wrong, just a little syntax error

PS: if you need electronics programs, check http://www.casiofortissimo.co.nr :)

#3 shadows_cl

shadows_cl

    Newbie

  • Members
  • Pip
  • 9 posts

  • Calculators:
    cfx-9850gb plus

Posted 05 September 2004 - 10:25 AM

hey andy. TU hablas espa?ol?.. sabes.. el programa no me funciona.. e hice todo lo que tu me indicaste, sigue mostrando el error de sintaxis.

#4 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 05 September 2004 - 10:40 AM

You just have to write If Q = 0 , not If Q = "0".

#5 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking &amp; Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool &amp; Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 05 September 2004 - 10:42 AM

sorry, i can only count to 10 in spanish, say hello etc. if you need someone who speas spanish, ask Betoe, he will come online in about 6 hours

#6 shadows_cl

shadows_cl

    Newbie

  • Members
  • Pip
  • 9 posts

  • Calculators:
    cfx-9850gb plus

Posted 05 September 2004 - 10:48 AM

Sorry andy!!! :P .... I probe all codes in this post and no one is result, the code is:

"Ingrese la primera carga"
?->Q
If Q = 0
Then "Error"

i use this code and this not work...... look I respect the spaces on the code of top but this code :blink: .... i am very newie and i dont anything...

#7 shadows_cl

shadows_cl

    Newbie

  • Members
  • Pip
  • 9 posts

  • Calculators:
    cfx-9850gb plus

Posted 05 September 2004 - 11:02 AM

I rapair the code , but i have new one!!!!!

but can i goto the Q declaration variable if Q is 0??????

If Q=0
Then "Error"
Goto ????

???? = function to resolve my problem... i use the Gp casio com... i downloaded 2 minutes ago...

#8 shadows_cl

shadows_cl

    Newbie

  • Members
  • Pip
  • 9 posts

  • Calculators:
    cfx-9850gb plus

Posted 05 September 2004 - 11:16 AM

Sorry.. this post... close moderator please.... better i read the manual of the casio... an i resolve all my dudes... for now... maybe tomorrow i post another,... jejeje

#9 Deimos

Deimos

    Casio Freak

  • Members
  • PipPipPipPip
  • 107 posts
  • Location:Poland
  • Interests:3d modelling, paper models, BASIC programming-AFX (just beginning)

  • Calculators:
    AFX 2.0+

Posted 05 September 2004 - 11:24 AM

I rapair the code , but i have new one!!!!!

but can i goto the Q declaration variable if Q is 0??????

If Q=0
Then "Error"
Goto ????


Hmm.. shouldn't it look like this:

If Q=0 :newline:
Then "Error" :newline:
IfEnd

And if You use Goto, You'll have to place a label, like:

lbl Q
or
lbl 1
somewhere in the program. For labels You can use only one digit or character (A to Z, r, theta)
Note that lbl Q has nothing to do with variable Q - label marks a spot in program where You want to jump. So for example, if You assigned 1 to variable Q, Goto Q command won't take You to lbl 1, but to lbl Q. If lbl Q doesn't exist, You'll get a "jump error" message. It's like with lists or pictures - You can't recall a picture or list using variables, only numbers.

One more advice - if You write a program where You use many conditions (If) or lops (while, for), always close them, eg. when You open a loop using While, immidietely close it using WhileEnd. Do the same with for using next and with If using Ifend. Else You'll get a syntax error at the end of the program and it might be very hard to find a loop You left open...

#10 shadows_cl

shadows_cl

    Newbie

  • Members
  • Pip
  • 9 posts

  • Calculators:
    cfx-9850gb plus

Posted 05 September 2004 - 11:54 AM

Lbl 1
"INGRESE LA 1 CARGA"
?->Q
If Q=0
Then Goto 2
Lbl 2 "LA CARGA NO PUEDE SER CERO"
Goto 1
Else Goto 3
Lbl 3 "INGRESE LA 2 CARGA"
?->R
If R=0
Then Goto 4
Lbl 4 "LA CARGA NO PUEDE SER CERO"
Goto 3
Else Goto 5
Lbl 5 "INGRESE LA DISTANCIA"
?->D
If D=0
Then Goto 6
Lbl 6 "LA DISTANCIA NO PUEDE SER CERO"
Goto 5
Else Goto 7
Lbl 7 ((QXR)/D^2)->T
T_
END

WHERE
/ = divition
_ = show triangle

this work in the casiocom, but in my calc show an error .. say go ERROR

#11 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 05 September 2004 - 12:28 PM

AAAAAAAAAAAH :banghead:
Please please please don't use goto like that :cry:

Do
"INGRESE LA 1 CARGA"
?->Q
Q=0=>"LA CARGA NO PUEDE SER CERO"
LpWhile Q=0

Do
"INGRESE LA 2 CARGA"
?->R
R=0=>"LA CARGA NO PUEDE SER CERO"
LpWhile R=0

Do
"INGRESE LA DISTANCIA "
?->D
D=0=>"LA DISTANCIA NO PUEDE SER CERO"
LpWhile D=0

((QXR)/D^2)->T
T_

Please forget Gotos for now, there are other instructions quite more efficient for this... ;)

#12 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 05 September 2004 - 05:27 PM

to explain orwells nice reaction:

you can not jump arround in If statments since somewhen there
will be a if end missing.

Also you don't need a goto if you just want to go on in the next line :) :D

#13 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 05 September 2004 - 05:40 PM

Yes and goto == (unreadable programs, bugged programs, bad programs)

#14 Daruosh

Daruosh

    Casio Freak

  • Members
  • PipPipPipPip
  • 285 posts
  • Gender:Male
  • Location:Tehran - Iran
  • Interests:Computer Programming, Electronics, Image Processing, Neural Networks, AI, System Development, Calc, Guitar, Music,

  • Calculators:
    CP 300 OS 3.03, Algebra FX 2.0 Plus ROM 1.05, CG-20

Posted 06 September 2004 - 07:33 PM

Yes and goto == (unreadable programs, bugged programs, bad programs)

<{POST_SNAPBACK}>


Exactly, but sometimes inevetible

#15 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 08 September 2004 - 03:40 PM

its also very usefull for jumping to the top of a program, as it starts looking for the Lbl at the top.

#16 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking &amp; Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool &amp; Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 08 September 2004 - 03:46 PM

if you use Goto and lbl carefuly thay can be very useful, but there is usually a better way to do somthing. before i knew how to use BASIC properly i did things like this:

0->A
Lbl 0
Isz A
//code
A=10=>Goto 1
A<10=>Goto 0
Lbl 1

hehe, then i learnt about For loops ;)

#17 Bija

Bija

    Casio Fan

  • Members
  • PipPip
  • 44 posts

  • Calculators:
    Graph 25, Graph 100+ 1.05

Posted 08 September 2004 - 04:16 PM

yeah this is more simple :
for 1-> A To 10
Next


#18 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 08 September 2004 - 10:19 PM

It's funny to do Basic programs without a single goto :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users