Discuss using and improving Lua and the Lua Player specific to the PSP.
Moderators: Shine , Insert_witty_name
MagicianFB
Posts: 11 Joined: Mon Oct 10, 2005 8:45 am
Post
by MagicianFB » Mon Nov 07, 2005 9:32 am
Is there any way to convert a string to normal code?
for example
Code: Select all
print(tocode("3+3"))
would print 6
KawaGeo
Posts: 191 Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains
Post
by KawaGeo » Mon Nov 07, 2005 11:56 am
<Deleted>
Geo Massar
Retired Engineer
LuMo
Posts: 410 Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:
Post
by LuMo » Tue Nov 08, 2005 4:25 am
save to file and dofile() ?
any better ideas?
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Bob535
Posts: 56 Joined: Fri Nov 04, 2005 6:52 am
Post
by Bob535 » Tue Nov 08, 2005 5:41 am
You could use it to return code from a function, although there are ways around this of course. One use may be for if you are inputing code via a text editor to be run by the program.
MagicianFB
Posts: 11 Joined: Mon Oct 10, 2005 8:45 am
Post
by MagicianFB » Tue Nov 08, 2005 8:01 am
print(assert(loadstring("3+3"))) -> 6