Jump to content



Photo

Project: Cplua


  • Please log in to reply
858 replies to this topic

#681 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 13 September 2006 - 07:37 PM

There are several differences with the standard version.
The biggest difference is that with CPLua each Lua file has its own environment. You cannot share variables between files as easily as with the standard version. If a file A uses a file B, then B may explicitely export some variables to A (so A can use it), but they are completely isolated by default. :rolleyes:

There are a lot of changes in the available packages and libraries too. The functions that are available in CPLua are listed in the file "functions.lua" in the ZIP file. You also have access to the standard packages "math", "string", "table", "coroutine" and "debug", with sometimes some differences :)

The future documentation should explain all of this in detail (but I really need more tiiiiiiiiime to do it :cry: )

#682 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 14 September 2006 - 04:09 PM

CPLua 0.9C is ready. :D
Several small bugs have been fixed.
And there is now a lot more memory available for Lua programs! :)

Also please don't forget to consider my suggestion about the require() function on the previous page :rolleyes:

#683 far2055

far2055

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Iran
  • Interests:Robotics - Programming - Mathematics - Physics - Computer <br />ANN ( Artificial Neural Network )<br />QBasic Lover-->before-->now-&gt;*CPLua&quot; Lover.

  • Calculators:
    classpad 300

Posted 14 September 2006 - 10:57 PM

Orwell i think there is a bug with "pict.capture()" . there is a memory leak!
try this code:
require("draw")
pic=pict.new(160,240)
for i=1,1000 do
pic=pict.capture("screen")
end

--insufficient memory to run!
another bug happend by using "math.floor()"
some code like this:
a=3
b=10
c=.3
d=math.floor((a-b)/c)  --exception happend !
d=math.floor(math.abs(a-b)/c) --that is O.K !

and please explain me a little about garbage collecting mechanism in CPLua.thanks. :)

#684 Cesar

Cesar

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    CP300, AFX2.0, SVPAM

Posted 16 September 2006 - 03:24 AM

Hi
When I use this code:
print(type(5e0.5))
lua displays: syntax Error:
')' expected near '.5'

Why?

And this other
e="one string"
b=string.gsub(a,"one","another")
print(a)
print(B)

Lua displays: Runtime error
main: 2 attempt to index global 'string'(a nil value)

As you know Im using The "Programing in Lua" book

#685 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 16 September 2006 - 03:55 AM

And this other
e="one string"
b=string.gsub(a,"one","another")
print(a)
print(B)
Lua displays: Runtime error
main: 2 attempt to index global 'string'(a nil value)


see my half-completed lua tutorial. the dot is used for indexing tables.. you need to call the package string before using any of his functions. type: require("string") at the code beginning. read CPLua examples included on the release, to overview that i mean.

Hi
When I use this code:
print(type(5e0.5))
lua displays: syntax Error:
')' expected near '.5'
Why?


Man, your'e wrong :huh: . this is scientific notation (exp on ordinary calcs). the powers are integers. if you need to use EXPONENTIALS use math.exp() function (y=e^x). be care with your maths, it can damage your prog seriously ;)

orwell, really there is a bug with math.floor, i have one some ago :!: . Thanks for 0.9C :thumbsup:

#686 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 16 September 2006 - 09:42 AM

Orwell i think there is a bug with "pict.capture()" . there is a memory leak!
try this code:

require("draw")
pic=pict.new(160,240)
for i=1,1000 do
pic=pict.capture("screen")
end

--insufficient memory to run!

Wow :blink: Nice catch. :huh:
That's strange, first there shouldn't be any leak and second it shouldn't cause a crash... I'll investigate :rolleyes:

another bug happend by using "math.floor()"

That's strange too... :blink:

and please explain me a little about garbage collecting mechanism in CPLua.thanks. :)

In brief:
Data's (tables, functions, strings, userdata, and threads) are kept in the memory as long as you can access it. While there is somewhere a reference to those data, they won't be deleted.
But if there is no reference to it anymore, the data is marked as "deletable", which means that it will be automatically deleted during the next garbage collection cycle. You don't have to worry about memory usage: data's are automatically deleted when you no longer use it.
An easy example is ...
a = {...}  -- create a (big) table, referenced by "a"
collectgarbage()  -- call the GC
print(a, gcinfo())  -- the table is still there
b = a  -- let "b" reference the same table as "a"
a = nil  -- now lose the reference "a" to the table
collectgarbage()  -- call the GC again
print(b, gcinfo())   -- and the table is still there, because "b" still points to it
b = nil -- now lose the second reference
collectgarbage()  -- call the GC once again
print(gcinfo())   -- now you can see that the table has been deleted, because you had lost all access to it.
The GC is perodically called while the interpreter is running, so (except for very large scripts) you shouldn't worry too much about that ;)

#687 far2055

far2055

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Iran
  • Interests:Robotics - Programming - Mathematics - Physics - Computer <br />ANN ( Artificial Neural Network )<br />QBasic Lover-->before-->now-&gt;*CPLua&quot; Lover.

  • Calculators:
    classpad 300

Posted 16 September 2006 - 11:22 AM

Really thanks Orwell for your explanations about garbage collector. :)

#688 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 16 September 2006 - 10:29 PM

Orwell... Exeption Error with 0.9C and some examples of the UI. :( :. The 0.9b3 that you sent me doesn't have these problems. See ya :)

#689 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 17 September 2006 - 10:07 AM

There are some problems. Some examples in the ui example doesnt work, fatal error, so orwell should take a try in the new version ui.

#690 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 17 September 2006 - 02:49 PM

Okay thanks, I will take a look... <_<

#691 Fabri

Fabri

    Newbie

  • Members
  • Pip
  • 21 posts
  • Location:Quito Ecuador

  • Calculators:
    Casio Classpad 300
    Casio fx 6300G

Posted 19 September 2006 - 01:23 AM

hi

when i was running CPLua the example 2 of ui examples, my classpad crashed and fatal error was displayed in the screen the same problem ocurred in the emulator of CPLua 0.9 C

could you tell me when should i use ":" to dots in CPLua??

#692 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 19 September 2006 - 04:42 AM

The same with me.

Orwell, 0.9c is really slower than before!

#693 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 20 September 2006 - 12:17 PM

Yes. Here is a simple example:

require("draw")

fullscreen(1)
showgraph()
draw.onbuffer()

for r=150,0,-2 do
 draw.circle(80,114,r,3)
 draw.update()
end

Run this code on CPLua 0.8 and CPLua 0.9c and compare.... <_<

And i found a bug when writing images to memory:

require("draw","io")

f=io.file("test")

p=pict.load("pict1")

f:create("data","Test")
f:open('w')
f:write(p)
f:close()

f:open('r')
p2=f:read(1)
f:close()

showgraph()
draw.pict(0,0,p2)

waitkey()

This bug doesn't occur when you write p=pict.copy(pict.load("pict1")) instead of p=pict.load("pict1")

:unsure:

And when you create a line edit using ui.lineedit, it's not editable, even if you put edit=true... <_<



I'm programming some Worms game, but I can use neither CPLua 0.8 (memory) nor CPLua 0.9c (drawing functions too slow...) :(

#694 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 21 September 2006 - 02:13 AM

People.. let Orwell to breath a bit :) . The problems with screen speed came from the UI implementation and the function that performs the draw.update() is stinky now :D . Orwell is finding how to recode it for future versions. the function needs an ASM programmer :nod: . Wait a bit.. check out the 1.2 MB of RAM. and wait until CPLua 1.0.

thaaanks

PS: Please.. read the last posts before ask!.. i said:

Orwell... Exeption Error with 0.9C and some examples of the UI. :. The 0.9b3 that you sent me doesn't have these problems. See ya

Vanhoa and Fabri repeated the quote without quoting. Orwell would piss off our complaints :D . Be patient people, big things will come with lua

#695 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 21 September 2006 - 08:45 AM

People.. let Orwell to breath a bit :) .

Thanks :D

Don't worry guys, I don't forget these problems and I'm still working on CPLua :rolleyes:
Actually I'm currenty rewriting the whole interface (with the editor etc), and I need a little more time... But it will be a lot more flexible than before (for example, the editor will also be able to open a bitmap editor or a help browser without problem :P ).

#696 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 21 September 2006 - 10:44 AM

Thanks, waiting for the next version.

#697 Fabri

Fabri

    Newbie

  • Members
  • Pip
  • 21 posts
  • Location:Quito Ecuador

  • Calculators:
    Casio Classpad 300
    Casio fx 6300G

Posted 22 September 2006 - 12:32 AM

Sorry is somebody was unhappy when i post my message i only do that in UI examples says "if exist any error public this in this forum" words writen by Orwell in those examples

#698 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 22 September 2006 - 08:22 AM

There is no trouble. You did well ;)

#699 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 23 September 2006 - 06:35 PM

For the lua heavy users, i did some benchmarking yesterday.. the available RAM is 1212 Kbytes, how to see the memory consumption? use collectgarbage("count") function, you can print the result, or put it on statusbar (further details in LUA 5.1 manual)

#700 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 23 September 2006 - 07:40 PM

Ahem... This is true with the current OS version (2.20). :unsure:
Unfortunately there are a lot chances that OS 3.0 will be a little bigger than OS 2.20, therefore there will be less RAM memory available for CPLua in the future. But don't worry, I think you should have at least 500 Kb of available RAM even with OS 3.0 (in the worst case). :)
Although 500 Kb is not as huge as the current 1212 Kb, I think it's still comfortable. Please try to allocate memory in a reasonable way (do not allocate several hundreds of Kb memory if there is just a "chance" that the user makes use of it: do it only if he really needs it.) Sparse tables may help too. ;)

PS: I hope that CPLua 0.9D will be ready in a couple of days ^_^

#701 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 23 September 2006 - 10:05 PM

Ahem... This is true with the current OS version (2.20). :unsure:
Unfortunately there are a lot chances that OS 3.0 will be a little bigger than OS 2.20, therefore there will be less RAM memory available for CPLua in the future


I know Orwell, you said me... :) .btw, i will buy a CP300+ with O.$ 3.0 ($$$$$$$$$$$$$$$).. then i will never update my old CP to O$ 3.0 :plol: .. then, i'll have the whole piece of cake in my old calc!,

PS: I will write some no the tutorial in some hours, i forgot the tut :P

#702 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 28 September 2006 - 12:12 PM

:!: New update!

CPLua 0.9D is ready :)

At first sight there aren't many new features in this version.
The update 0.9C -> 0.9D has been an heavy refactoring step, making CPLua a lot more flexible and extensible than the previous versions. CPLua now uses a system of plugins, and it is very easy to create some new plugins and make it interact with CPLua's environment (managing windows etc) and the other plugings.
For example, the text editor and the Lua interpreter inside CPLua are simple plugins loaded in the environment. One could imagine sereval new things, like a picture editor, a project manager, a help browser, a "MyPrograms"-like menu, ... :D
As CPLua's source code should be available soon, different programmers will get able to create these kind of new plugins and extend the functionalities of CPLua ;)

I had to rewrite a lot of things, thus perhaps some minor bugs that I fixed before reappeared in this version. If you see something weird, don't forget to report it here :rolleyes:

The biggest visible change concerns CPLua's main menu. I wanted to reorganise it too (and make it accept any number of commands), thus here is what you will now see when starting CPLua: ^_^

Posted Image

According to the suggestion I made recently about the default folders, the functions require, dispose, doscript, io.file, pict.save and pict.load have been modified to use the folder of the calling script as default folder. These last 3 functions were also taking 2 arguments for the path (one for the folder name and another for the file name); they now take only one argument with the complete path.

I added a small menu to the Console window too with some useful things :rolleyes:

The bug in pict.capture() has been fixed (thanks for having reported it), and you can now specify a region of the screen to capture (it doesn't have to be the whole screen anymore) ;)

There are several small things I'd like to add before CPLua 0.9RC1, but this version is very close to what the final CPLua 0.9 will be.

Have fun :)

#703 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 28 September 2006 - 12:17 PM

Goob job Orwell, I'm testing it.

#704 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 28 September 2006 - 12:33 PM

Great! :greengrin:

#705 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 28 September 2006 - 05:37 PM

WTF! Orwell! GREAT JOB!.. How you can do these marvels in only few days??.. really you know about human-based multitasking :D

#706 far2055

far2055

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Iran
  • Interests:Robotics - Programming - Mathematics - Physics - Computer <br />ANN ( Artificial Neural Network )<br />QBasic Lover-->before-->now-&gt;*CPLua&quot; Lover.

  • Calculators:
    classpad 300

Posted 29 September 2006 - 09:47 AM

Thanks Orwell. Great work. :)

#707 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 29 September 2006 - 10:32 AM

:!: New update!

CPLua 0.9D is ready :)

The new interface is not very appealing, but "Recent Files" is really useful. Unfortunately, LNAtest needs 27 sec (instead of 25 sec in version 0.8), but it seems that larger computation times is the payoff for bigger memory. I'm going to test version 0.9D thoroughly in the next few days, since I will change several things in the upcoming LNA 1.70.

#708 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 29 September 2006 - 12:48 PM

The new interface is not very appealing

:blush: I must say I don't have any skills in graphical design, thus if anyone has a better project for the "Start" page just let me know :lol2:
It is more convenient however, you don't have to close all files to see the main menu like in the previous versions :)

#709 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 29 September 2006 - 04:59 PM

CPLua now uses a system of plugins, and it is very easy to create some new plugins and make it interact with CPLua's environment (managing windows etc) and the other plugings.
For example, the text editor and the Lua interpreter inside CPLua are simple plugins loaded in the environment. One could imagine sereval new things, like a picture editor, a project manager, a help browser, a "MyPrograms"-like menu, ... :D
As CPLua's source code should be available soon, different programmers will get able to create these kind of new plugins and extend the functionalities of CPLua ;)


Yay! Let's make some MyLuaPrograms menu and font maker. :D

The new interface is not very appealing


I find it rather nice although it can be ameliorated.
I'm going to test it right now. :)



EDIT:
Hehe, I like the console menu :) That's exactly what I needed.
But on the other hand the draw function are still slower than before. :(

And I found a small bug. You told that require("script") was searching first for a Lua script in the current folder, and then in main folder. But I have a "font" script in main, and when I call require("font") in a file in another folder, it raises an error. :huh: This doesn't happen when I write require("main/font")



#710 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 30 September 2006 - 02:25 AM

But on the other hand the draw function are still slower than before



Wait for the ASM coded one.. It would be a lot faster :)

#711 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 30 September 2006 - 04:08 AM

ASM coded? What do you mean?

#712 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 30 September 2006 - 04:15 AM

The function that draws the screen is slow. It need to be recoded on ASM to get it faster

#713 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 30 September 2006 - 08:34 AM

You told that require("script") was searching first for a Lua script in the current folder, and then in main folder. But I have a "font" script in main, and when I call require("font") in a file in another folder, it raises an error. :huh: This doesn't happen when I write require("main/font")

Well it was an idea indeed, but actually this is not the way I implemented it :unsure: The main folder will only be used if the calling script has no folder (e.g. for new scripts). I'm not really sure what to do. I think it could be confusing to have 2 default folders instead of 1 :huh:

#714 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 02 October 2006 - 11:19 AM

Input a string and treat as function.

#715 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 02 October 2006 - 01:58 PM

? :huh:

#716 omegavirus

omegavirus

    Casio Freak

  • Members
  • PipPipPipPip
  • 150 posts
  • Gender:Male
  • Location:Morelia, M?xico

  • Calculators:
    ClassPad 300

Posted 02 October 2006 - 04:17 PM

I like the new version, thanks to Orwell :D , it has a lot o new features also it is closer to a final version. by the way the new version is slower than the last one for example when you open a program it takes some time to be able to run it and also when I was converting my programs in to text (new format of programs in CPLua) I had like 3 windows and also the star window and the classpad crashed but I could not reproduce the bug again...

#717 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 04 October 2006 - 02:11 AM

? :huh:

For example: f=input("f(x):") and you input x^2 then we have a function f(x) x^2 end

#718 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 04 October 2006 - 08:29 AM

This is a situation where dostring() will help :)
f = dostring( "return function(x) return " .. input("f(x)=") .. " end" )
Don't forget that in the expression you must use Lua names for math operations (e.g, input "math.cos(x)" instead of "cos(x)" ).

#719 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 04 October 2006 - 11:44 AM

:blink: I didnt know that before

#720 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 04 October 2006 - 12:02 PM

Ahem... actually it should have worked like that <_<

I forgot to let dostring() return the results of the executed string, thus dostring() will only return nil in the current version. :angry: This will be fixed in the next version ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users