Jump to content



Photo

Uses Variables?


  • Please log in to reply
5 replies to this topic

#1 Colombia

Colombia

    Casio Addict

  • Members
  • PipPipPip
  • 94 posts
  • Gender:Male
  • Location:Venezuela

  • Calculators:
    algebra FX 2.0 plus
    Classpad 300

Posted 07 June 2006 - 12:25 AM

I`ve a program on CPLua folder, but i need to use a variable stored on main folder

How I can call this variable to my program on another folder????

#2 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 07 June 2006 - 12:28 PM

I`ve a program on CPLua folder, but i need to use a variable stored on main folder
How I can call this variable to my program on another folder????

Assume that a variable named "foo" is stored in the "current" folder. Simply use cas("foo"). Unfortunately, this works only for variables stored in the "current" folder, as shown in CP's variable manager. Normally, you could also access variables stored in another folder by using the more general form cas("folder\variable), but this doesn't work as expected. Orwell???

#3 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 07 June 2006 - 01:47 PM

To be honest, as I'm not a CPBasic user, I never saw the real utility of the "current folder"... But this could be a case were it is needed. If you need something to set the current folder, just say it: I'm still opened to suggestions ;)

If you find some Basic functions that do not exist in Lua (like PrintNatural), don't hesitate to propose (in the "Suggestions" topic) the lua functions that you would like to see in the next releases :)

#4 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 07 June 2006 - 02:28 PM

To be honest, as I'm not a CPBasic user, I never saw the real utility of the "current folder"... But this could be a case were it is needed. If you need something to set the current folder, just say it: I'm still opened to suggestions ;)

I'm not a CPBasic user as well, but "current folder" is not directly related to CPBasic. It is the folder where variables assigned in the "Main" application will be stored, and can be changed using the Variable Manager. You are right, it's annoying, but how can we access variables from CPLua that are stored to any folder? cas("folder\variable") does not work, while folder\variable is a valid CAS command, used to access variables stored anywhere.

#5 Tchernoben

Tchernoben

    Casio Fan

  • Members
  • PipPip
  • 42 posts
  • Location:Nice
  • Interests:Calculators, Pc, mangas, warhammer.

  • Calculators:
    Classpad 300
    Ti 89 Titanium

Posted 04 August 2006 - 08:10 PM

put this var in a table then export the table !
local x = 5 -- for example
table = { x }
export ( table )
in ur main prog
require ( dir/name_of_the_file )
print ( table.x ) -- 5

please correct me if I'm wrong

#6 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 04 August 2006 - 10:38 PM

T'es un peu ? c?t? de la plaque ;)

Not really, this is not the problem they were speaking about :rolleyes:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users