Jump to content



Photo

Question About Cplua 0.8


  • Please log in to reply
3 replies to this topic

#1 Hobart

Hobart

    Casio Fan

  • Members
  • PipPip
  • 34 posts
  • Gender:Male
  • Location:Germany (Saxony/Ore Mountains)

  • Calculators:
    ClassPad 300

Posted 14 March 2007 - 12:23 PM

Hi all!
I only use CPLua for programming.
But I do not know yet how to convert a string to a variable name.
Could someone help me?

#2 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 14 March 2007 - 12:40 PM

wrong forum, moved

#3 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 14 March 2007 - 07:46 PM

Well there is no special command to do that in Lua (as there is one in Basic)...
But one possibility is :

abc = 9
varName = "abc"
print( getfenv()[varName] ) -- prints 9
I hope it will help :)

#4 Hobart

Hobart

    Casio Fan

  • Members
  • PipPip
  • 34 posts
  • Gender:Male
  • Location:Germany (Saxony/Ore Mountains)

  • Calculators:
    ClassPad 300

Posted 16 March 2007 - 01:22 PM

Yes! It works!
Thank You much! :greengrin:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users