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 - 12: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 - 01: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 - 03: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

  • [Legends]
  • 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 - 04: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 - 07: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 - 03: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 - 01: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. ;)


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users