Jump to content



Photo

Goto In Cplua?


  • Please log in to reply
6 replies to this topic

#1 Xerxes

Xerxes

    Casio Freak

  • Members
  • PipPipPipPip
  • 130 posts
  • Gender:Male

Posted 20 February 2007 - 01:26 PM

Is it possible to use Label and Goto in CPLua?

#2 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 20 February 2007 - 02:51 PM

No, and it will never be. :rolleyes:

#3 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 20 February 2007 - 04:48 PM

Use While, For and Repeat loops, it's much better. Labels should never be used.

#4 The_AFX_Master

The_AFX_Master

    Casio Overlord

  • Admin
  • PipPipPipPipPipPipPip
  • 519 posts
  • Gender:Male
  • Location:Black Mesa Research Facility (sector C)
  • Interests:BASIC +FORTRAN 90+ C++.....and HALF LIFE

  • Calculators:
    Casio Algebra FX 2.0 Plus, Casio fx 570 ms, Classpad 300, And a crowbar

Posted 20 February 2007 - 05:20 PM

Yes, totally agree. In fact, Goto's are for vacuum tubes computers and Fortran IV, COBOL! :roflol:

#5 Xerxes

Xerxes

    Casio Freak

  • Members
  • PipPipPipPip
  • 130 posts
  • Gender:Male

Posted 20 February 2007 - 08:07 PM

Thanks for your advice, but of course I usually don't use Goto also, except for languages like Assembler or keystroke calculators. ;)

I asked to know, if it is neccessary to make a structured version of a non-structured program to execute it at CPLua. In C for example it is possible to use Goto.

#6 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 681 posts
  • Gender:Male
  • Location:Somewhere in Europe.
  • Interests:Computer Algebra, Numerical Analysis.

  • Calculators:
    ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 21 February 2007 - 04:45 PM

Is it possible to use Label and Goto in CPLua?

Gotos? Brrrr... :crimson:

I asked to know, if it is neccessary to make a structured version of a non-structured program to execute it at CPLua. In C for example it is possible to use Goto.

If you have a non-structured code that you really need, you must translate it to CPLua. This task may be horribly difficult, especially if the non-structured code uses gotos extensively... in that case, translation is a real nightmare, and I personally prefer to rewrite the code from scratch.
However, I don't think that CPLua is a real "structured" language (at least not as structured as Fortran 95 or Pascal). CPLua allows data hiding, which is very-very useful for structured programming, but there is no variable declaration, which reminds me the old Basic. Anyway, CP is a calculator; that being said, CPLua is "structured enough", fast, and by far better than CPBasic.

#7 Xerxes

Xerxes

    Casio Freak

  • Members
  • PipPipPipPip
  • 130 posts
  • Gender:Male

Posted 22 February 2007 - 02:00 PM

I agree, that it's better to make a new version of the code before trying to translate it. The reason for asking is, that I am looking for different calculators and programming languages for benchmarking. The algorithm is not structured because of the minimal language of some calcs, to have exactly the same duty. Of course it's possible to make a structured version, but until now it was not neccessary. ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users