Jump to content



Photo

Project: Cplua


  • Please log in to reply
858 replies to this topic

#561 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 26 March 2006 - 11:35 AM

Yes, but I cannot take my PC nor notebook everywhere... and this what Im doing on Classpad do not outranges its posibilities,or Im wrong?

#562 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 March 2006 - 12:51 PM

Well, the CP does not have too much memory... I'm not sure that you could handle so many matrices and variables with CPBasic btw ;)

#563 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 26 March 2006 - 01:16 PM

The only files that CPLua's editor can edit are the files containing Lua programs... I don't exactly see what you would mean by "open images or MEM files" :unsure:


For example, I'm writing a program which uses "resource files" which contain pictures, or user-defined libraries. This would be great if the source code and the resources were compiled into one file (like a .EXE). So there would not be folder name problems, accidentally deleted resource files, etc...

#564 Fabri

Fabri

    Newbie

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

  • Calculators:
    Casio Classpad 300
    Casio fx 6300G

Posted 30 March 2006 - 10:01 PM

Hi my question is about CPlua Pict convert its an utilitie for CPLUA??, this addin are usefully created??


I hope that understand me

#565 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 31 March 2006 - 12:22 PM

This utiity converts PICT file into library which can be used in Lua (require "your_pic"). You just call created function with a position of image (where You want to put it) as arguments and picture is drawn on screen... but since Orwell introduced IO library PICT Convert is obsolete.. read more about Lua functions in "functions.txt" included in every new Lua package.

#566 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 31 March 2006 - 03:08 PM

but since Orwell introduced IO library PICT Convert is obsolete.. read more about Lua functions in "functions.txt" included in every new Lua package.


Moreover, Lua Pict Convert is completely unusable! :plol:

#567 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 04 April 2006 - 04:28 PM

Help needed!
-----------------//
(immediately)

I use "toPol" (CAS function) to convert from rectangular to polar coordinates... but when I use "cas.elem(vector,1,2)()" I get error becouse angle is displayed with "<" angle sign... so I cannot use it later for calculations... any ideas?

#568 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 04 April 2006 - 08:40 PM

Do you really need CAS for that? :unsure:

function toPol(x,y)
 local r,t
 r=math.sqrt(x^2+y^2)
 t=math.acos(x)
 return r,t
end


#569 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 04 April 2006 - 09:53 PM

Do you really need CAS for that? :unsure:

function toPol(x,y)
 local r,t
 r=math.sqrt(x^2+y^2)
 t=math.acos(x)
 return r,t
end


I have here whole string of CAS calculations... I wouldnt like to mix this all. Not always easiest way is best :)

#570 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 04 April 2006 - 10:30 PM

Ahem :P
t=math.atan(y/x)
Nice try ;)

I'm sorry Tom I never use this function "toPol", and I have no idea of solution to your problem :blink:

#571 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 05 April 2006 - 11:35 AM

Ahem :P

t=math.atan(y/x)
Nice try ;)


Oops, sorry, as I never use toPol, but usually toRect, I mixed the both functions! (x=r*math.cos(t)) :blush:

#572 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 05 April 2006 - 01:34 PM

I tried to write very modest Automatic Radar Plotting Aid :) but it seems CAS functions are too slow, HELP NOT MORE NEEDED :( Only HeadPad will be useful here :P

#573 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 05 April 2006 - 09:50 PM

I'm currently preparing a new version of CPLua for this week.

I know that it's still supposed to be a RC version (the last one before CPLua 0.8 final :rolleyes: ) which only fixes some last small bugs, but I couldn't resist the temptation of adding the "debug" package :P
It's now possible to enter interactive mode by calling debug.debug() (or simply debug()). This gives you full access to all functions and variables (even local variables and upvalues) :)
All functions of the "debug" package may be used to obtain informations about a function, the environment, the metatables, the register etc (see the Lua 5.1 Manual for details).

However, I don't think that I will keep the two functions debug.sethook() and debug.gethook()... They could be useful (for example to execute some code line by line and trace the results), but the problem is that CPLua is already using a special hook to handle external events like key press, button/menu press, screen updates etc... And it wouldn't be a good idea to replace it by an ordinar Lua function, even for debugging purposes <_<
Maybe I will find an alternative, but for now these 2 functions will be unavailable.

Oh, and I also improved the input() function a little bit :lol:

#574 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 06 April 2006 - 12:44 PM

I couldn't resist the temptation of adding the "debug" package :P
It's now possible to enter interactive mode by calling debug.debug() (or simply debug()). This gives you full access to all functions and variables (even local variables and upvalues) :)

Everybody wants a debugger, even a simple one :). I hope that the Lua 5.1 manual explains how variables are accessed in debug mode, especially local or global variables with the same name (but different scope).
Although I'm very busy these days, I'm curious to see how the debugger works...

#575 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 06 April 2006 - 01:04 PM

:!: CPLua 0.8 RC4 is now available.

It contains several bug fixes from RC3, but also many additional features that were missing in previous versions:

-> The "debug" package is available :D Please refer to the Lua 5.1 Manual for details about its functions.
I must give 2 precisions though:
1) debug.sethook() and debug.gethook() are not available (for the reasons I mentioned earlier)
2) debug.debug() has been slightly modified for CPLua:
a. you may call debug() directly instead of debug.debug().
b. you may also give some arguments as parameters, which will be printed before entering the interactive mode.
c. pressing the "Break" button in the menu returns to normal execution ("cont" also terminates the debug mode)

-> There are 4 new useful functions: setdate(), getdate(), settime() and gettime(). :)
They are available by default. Refer to the file functions.txt for documentation :rolleyes:

-> The functions to iterate over files and folders have been improved. There is now a function io.folders() to iterate over folders, and the function fold:content() has been renamed in fold:files().
I added a small example "Files" in the file examples.mcs to show how to use them.

-> The function "input()" now accepts a string as parameter, which is displayed at the left of the input field. For example, you could pass something like "name:" or "X=". ^_^ This function doesn't return unless the user has entered a valid string (it must have at least one character)

-> You may type "exit" in interactive mode to close it.

-> require() now return itselfs at the end of its execution, and accepts several arguments. This makes it possible to write
require("table", "string", "foo/bar")
or
require "table" "string" "foo/bar"

-> ... I think I forgot something... nevermind. :P


As allways, I'm waiting for your comments before releasing CPLua 0.8 final :)
In the meanwhile I think I will start writing some documentation for CPLua.

#576 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 08 April 2006 - 09:34 AM

I just remembered what I forgot (thanks Kilburn): there is also a new function io.check() that checks if a file/folder name is valid (i.e. it is not too long and does not begin with a number) ;)

Edit: I found (and fixed) an annoying problem with doscript(), which raised fatal exception. The archive has been updated. :rolleyes:

#577 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 08 April 2006 - 12:33 PM

Edit: I found (and fixed) an annoying problem with doscript(), which raised fatal exception. The archive has been updated. :rolleyes:


There is also the same problem with require(), did you correct it too? When you write require("test") or doscript("test"), it raises a fatal exception, but if you write require("main/test") or doscript("main/test"), it works.

Edit: There is also this bug with pict.load (and maybe pict.save)

#578 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 08 April 2006 - 12:42 PM

There is also the same problem with require(), did you correct it too? When you write require("test") or doscript("test"), it raises a fatal exception, but if you write require("main/test") or doscript("main/test"), it works.

Edit: There is also this bug with pict.load (and maybe pict.save)

Argh, I fixed this for doscript, I didn't see that there was the same problem with require. <_<

Could you give me more details about the problem with pict.load?

#579 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 08 April 2006 - 01:04 PM

Could you give me more details about the problem with pict.load?


For example you have a picture "main\pict1". If you write p=pict.load(pict1) it raises a fatal error.
I didn't try with pict.save...

But io functions seem to be ok. :)

Edit: io.file don't support names with multibyte characters :unsure: It's not important for me,but I noticed that.

#580 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 08 April 2006 - 03:45 PM

New update done.

I didn't find any problem with pict.load() however :blink:

#581 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 08 April 2006 - 09:52 PM

Hi orwell, I started yesterday on the LUA world...THANKS A LOT! for the add-in

I have a problem, I?m coding a program that have a user graphic interface, a picture background with buttons that the user can press with stylus.

When the user press the buttons (with waitpen()), the console appears with the command input(), the problem is that when i put values, the program doesnt return to graph mode correctly. .(must be!)..returns..but in a blink! and skip the waitpen() command. this job is done in a repeat loop. i played with all!! showconsole, showgraph, draw.update and so on. an it does?t work!!! :banghead: .

this is the pseudo code

repeat
showgraph()
x,y=0,0
mainmenu()		   //routine that draws the pict
x,y=waitpen()		// this waitpen is skipped before 2 or 3 button entries!!!
type=gtype(x,y)   // this function does a relationship between the buttons and the screen  
							// coordinates...some concatenated if-then-end, no more

if type==1 then
showconsole()
clear()
list=input("enter values")
end

until type==0 // type is from zero to 9, if i press escape on screen, type is zero

another modification is with mainmenu() out of the loop an the draw.update() command in the loop


this "skipping" of waitpen is a bug? or i?m done a bad code?
a post about a problem as this: http://www.casiocalc.org/?showtopic=2447

thanks for your info orwell

#582 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 08 April 2006 - 10:17 PM

Your code is correct, it's a problem coming from CPLua... :(
The fact is that CPLua receives a signal "pen down" at the first time you use the pen, but it never receives the signal "pen up" because the current window (the graph window) is quickly replaced by the other one (the console window) which does not track the pen... Thus CPLua "believes" that the pen is still on the screen <_<
Handling with several windows is really tricky. I found a workaround by forcing CPLua to consider that the pen is immediatly removed after the call to waitpen(), but I'm not sure that it won't cause some other problems :rolleyes:
I will make another update soon and let the lua users try it ;)

By the way, I'm also working on a graphical using interface for CPLua (the "ui" package), but with real window, buttons etc ;)

#583 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 09 April 2006 - 10:03 PM

I will make another update soon and let the lua users try it ;)
By the way, I'm also working on a graphical using interface for CPLua (the "ui" package), but with real window, buttons etc ;)


Thanks orwell ...i would commit a suicide! (joke!) :D , the UI seems to be powerful, yesterday was trying to code an "array editor", works fine at moment,as spreadsheet, with custom table properties (cellwidth and other ones..). At now i?m using waitkey() with no problems :D . but i don?t know how to implement scrollbars, i need to do picture manipulation as pic.part()?, (as seen on your "logotile" example? i wasn?t read the code, is only a supposition)
other question: In my array editor i need to erase screen zones repeatedly, I now using pict.new(w,h), then i draw the same picture many times in the same zone (this is used to display the current cell :D ), this methow waste too much memory??, can Lua crash because an insufficient memory?, the graphs buffer store info in "layers" (all drawing operations in a sequence) 0r only a 160x240 bitmap that shows the actual screen state ?


Thanks for your info,

#584 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 10 April 2006 - 10:03 AM

i don?t know how to implement scrollbars, i need to do picture manipulation as pic.part()?,

Well, it doesn't sound easy to do.... :rolleyes: You could deal with pictures indeed, but I can't think currently of a good way to do it :unsure:

In my array editor i need to erase screen zones repeatedly, I now using pict.new(w,h), then i draw the same picture many times in the same zone (this is used to display the current cell :D ), this methow waste too much memory??

Drawing operations do not allocate memory. But pict.new() creates a new picture, and of course it needs memory for that... Do you really need to create a new picture each time? :huh: Note that the allocated objects (tables, pictures) are "unallocated" once you don't use them anymore, thus if you create a new picture, draw it, and lose reference to it, it will be destroyed later ;)
a = pict.new(10,10) -- first pict
a = pict.new(10,10) -- second pict, lose the first pict
... -- do some instructions
draw.pict(x,y,a) -- the second pict is still there
-- but the first pict has been silently destroyed because there was no reference to it anymore

can Lua crash because an insufficient memory?

If there is not enough memory, the Lua program will break. There shouldn't be a crash of CPLua - but if it happens, please report it ;)

the graphs buffer store info in "layers" (all drawing operations in a sequence) 0r only a 160x240 bitmap that shows the actual screen state ?

The buffer is a simple 160x240 pict indeed... You could use any picture as buffer instead by the way ;)

To everyone: I understand your motivation, but please don't make too much efforts to implement some new UI elements like buttons, scrollbars etc... I'm already working on something that will be quite more powerful ^_^
Here is an example of code (it's already working here) for the next versions after CPLua 0.8 (but it won't be available before a couple of weeks, sorry :():
require "ui"

w = ui.window("A window", 30,20,100,140)

b = ui.button("Say Hello",10,10)
w:add(b)
b2 = ui.button("Quit",10,30)
w:add(b2)

function b:_clicked()
  print("hello!")
end

function b2:_clicked()
  ui.stop()
end

w:show()
ui.exec()
This is only a very small example of the features of the "ui" package.
Please be patient, this should be a great package ;)

#585 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 10 April 2006 - 10:59 AM

This is only a very small example of the features of the "ui" package.
Please be patient, this should be a great package ;)

Wow! It will be that easy? You can even define actions, such as button_clicked, combobox_modified (or something similar)? Ideal for menus, "settings" or "options" windows. Plenty of game developers will be satisfied, but it will be also useful for my "driver" LuaNumAn programs (not for the core of LuaNumAn though).
However, if you add the "ui" package in version 0.8, there will be release candidates 5, 6, 7, ...., since it will need heavy testing.

Btw, I'm planning to write a "LuaTest" benchmark program, which will use LuaNumAn numerical methods to solve some time consuming problems, compare the results with a data file (to test efficiency) and measure the computation time. It will be very useful for testing new versions of CPLua.

#586 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 10 April 2006 - 11:55 AM

Wow! It will be that easy? You can even define actions, such as button_clicked, combobox_modified (or something similar)?

That's the goal :) It will take time though, because there are a lot of features to implement, but the basis are already set and work correctly ^_^

However, if you add the "ui" package in version 0.8, there will be release candidates 5, 6, 7, ...., since it will need heavy testing.

This package is planned for CPLua 0.9, I'm currently working on a parallel version for my tests with this package ;) I will wait a couple of days to let the users test CPLua 0.8 RC4 and report some last bugs if needed, then I will truly release CPLua 0.8. I think that there are already a lot of new things since CPLua 0.72 :rolleyes:

Btw, I'm planning to write a "LuaTest" benchmark program, which will use LuaNumAn numerical methods to solve some time consuming problems, compare the results with a data file (to test efficiency) and measure the computation time. It will be very useful for testing new versions of CPLua.

Indeed, that should be quite useful :)

#587 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 19 April 2006 - 06:04 PM

:!: CPLua 0.8 is finally out!
It is available here.

After a long wait, and a lot of beta versions/improvements/bug fixes, here is the last stable version of CPLua. :D

Here is a summary of the main (visible) improvements since CPLua 0.72:
- upgrading from Lua 5.0.2 to Lua 5.1
- "io" package
- pictures related functions in the "draw" package
- "debug" package
- the key [<-] may be used to found errors in a script
- file "CPLua/Prefs" used to save preferences

Have a lot of fun with it! :)

PS: Btw, if someone is interested in translating CPLua in another language (like Spanish), just let me know! There is only 20 lines to translate ;)

#588 rafapa

rafapa

    Newbie

  • Members
  • Pip
  • 14 posts
  • Location:Spain

Posted 19 April 2006 - 09:02 PM

:!: CPLua 0.8 is finally out!


PS: Btw, if someone is interested in translating CPLua in another language (like Spanish), just let me know! There is only 20 lines to translate ;)


OK, I'll try. Could you post the lines to be translated?

Thanks for all the work.
Just a curiosity. Why did you started to develop CPLua?

Rafael

#589 -Tom-

-Tom-

    Casio Freak

  • Members
  • PipPipPipPip
  • 104 posts
  • Location:Poland
  • Interests:Tides, Celestial Navigation, Deadreckoning

  • Calculators:
    Cla$$pad 300

Posted 20 April 2006 - 07:37 AM

Im also interested. Send me those lines on email if You can.

#590 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 26 April 2006 - 02:24 PM

another graphics problem :banghead:

I`m finishing my array editor for CPLua 0.8 :) but i have a small bug (me or CPLua, i don`t know)

the grid and cursor displacement (as CP spreadsheet), is coded and works fine. i have a function that draw on hidden buffer the lines of the grid contour. then i use pict.buffer() to store te buffer on a pict called "grid"
grid is drawn on the screen when i need. then when i attempt to draw numbers other function draws a white picture with the cell size in the current cursor position (to erase it). then the number is drawn with draw.text().


All the screen zone on the top and left of the point on the p?cture is drawn,moves 1 pixel to the left!!!! :blink: (as i used part.pict() command!!!),i need to solve this because this generates a double-thicked lines on the bottom of the number drawn following the column to the bottom of screen.this lines are the borders of the "two" separated screen sectors
the curious thing is when i press keyboard on the hard keypad...Voilaaa!! the bug is fixed and the screen sector on left returns 1 pixel to the right :blink:
another clue: this lines appears just when i load the"erasing" picture on the cell, before num drawing. if i skip this step, the num is drawn without problems but i can`t do corrections and erasings..


ps: Can the "ui" pack perform popups to imput values on showgraph() mode? where are the documentation to see the syntax of every function?

thanks a lot for your help

#591 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 April 2006 - 03:36 PM

I will contact all "translators" soon. Thanks for your help ;)

>> rafapa:
mastermage (another programmer) already thought long ago about porting the Lua interpreter on the ClassPad, but he never had the time to make it. Then I decided to see by myself how this could be done, and here is the result :)

>> AFX Master:
Hmm, I think that this problem actually comes from CPLua. But I will soon have to make some modifications on the "draw" window, and maybe it will solve your problem too. We will see how it goes with the next version :)
Btw,

i have a function that draw on hidden buffer the lines of the grid contour. then i use pict.buffer() to store te buffer on a pict called "grid"

Perhaps you could first create the pit "grid" and draw the grid on it directly (with draw.onpict(grid) instead of draw.onbuffer()) ;)

#592 Orwell

Orwell

    Casio Overlord

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

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 April 2006 - 10:07 PM

Just a few words to say that CPLua 0.9 is in heavy development, and the UI package as well :P

It is now also possible to manipulate the 2 standard windows (the console and the draw window):
require "ui"

print("Resizing the console")
c = ui.getwin("Console")
c:resize(20,20,100,100)

waitkey()
I let you imagine what we could do with this :D

#593 unique33

unique33

    Casio Freak

  • Possibly hacked
  • PipPipPipPip
  • 229 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    classpad 300 , fx5500

Posted 27 April 2006 - 09:28 PM

. Is there any change with the Camparition of a number with nil?
the thermodynamic tables contain nil values by deafult and
I should find a way to compare number with nil .
( I mean version .8 final)

. Is there any change in the printf Function?
run my "CATT/PsatV" program to see the error!
when I use the same statement in a new program there will be no error.
thats strange!
(I think it refers to the above problem)
any help/suggestion?

. Also write a single statement program with the printf function . the "Done"
word will follow the printf and do not go to the next line.



#594 unique33

unique33

    Casio Freak

  • Possibly hacked
  • PipPipPipPip
  • 229 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    classpad 300 , fx5500

Posted 27 April 2006 - 10:30 PM

About the Translation:
I Do not know if a Persian font (character set) will be posible or not .
If the font does not mater . So send me the Translation code too.

I hered that making the peg fonts is so simple , If it is so , the Tahoma Font in
the Windows Xp is good for Persian .
( If in your mind making peg fonts from windows fonts is not simple so send me a pm)

Thanks.



#595 Fabri

Fabri

    Newbie

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

  • Calculators:
    Casio Classpad 300
    Casio fx 6300G

Posted 01 May 2006 - 08:59 PM

Hola quisiera saber si existe un manual para progrmar en Lua o CPLua en Espa?ol
Gracias

#596 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 01 May 2006 - 09:46 PM

"Do someone know if there is a Lua programming manual in Spanish?"

I don't know, maybe search "Lua" on Google.... :huh:

#597 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 03 May 2006 - 01:50 PM

Google es buena opcion para tutoriales....el libro programming on LUA esta en ingles pero es una muy buena opcion. usa la documentacion de funciones que viene con CPLua en el readme

#598 Kilburn

Kilburn

    Casio Technician

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

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 03 May 2006 - 02:56 PM

I found a bug! Try this code:

require "draw"

print("Hello")
draw.line(10, 10, 20, 20)
draw.line(10, 10, 20, 20)
draw.line(10, 10, 20, 20)

waitkey()

A line is drawn on the console window! :blink: If you draw it 2 times, it won't work, you have to draw it 3 or more times. Really strange... :huh:

#599 unique33

unique33

    Casio Freak

  • Possibly hacked
  • PipPipPipPip
  • 229 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    classpad 300 , fx5500

Posted 07 May 2006 - 04:25 PM

I think there is a bug with the require function:
consider a file containing a table :

File A:
a={1,2,3,4,5} 
export{a=a}

File B:

require("fileA") 
require("table")
print(table.getn(a))

Output=0
why?

#600 unique33

unique33

    Casio Freak

  • Possibly hacked
  • PipPipPipPip
  • 229 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    classpad 300 , fx5500

Posted 07 May 2006 - 04:38 PM

I think there is a bug with the require function:



consider a file containing a table :

File A:

a={1,2,3,4,5} 

export{a=a}



File B:

require("fileA") 

require("table")

print(table.getn(a))



Output=0



why?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users