This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Deathura's profile picture

[DEV] DeDB (Database program)

Started by Deathura, 06 March 2012 - 04:09 PM
Deathura #1
Posted 06 March 2012 - 05:09 PM
Hello guys, my first programming project is to make database program to CC. As title should say, it's in development, and i will let the code be open source all time as i update it, so you can modify or/and use it freely. Of course, you need to keep "– author Deathura " always where it is. Nothing more. And of course not say that it's yours. You know.

Aim of program:
  • Storage any type of data
  • Allow to have relations between data (This is now pulled of from main features, I'll see later will i do it)
  • Use program over it's own GUI or integrate it to your systems and programs with API
TODO:
  • API
CODES:

I have quit the using the launcher, and having time for the API now.

SpoilerVery first version of API, having only two methods, and therefore useless now. Also neither tested yet.


-- DeDB API
-- Database
-- @author Deathura

function create_db(dbname)
if fs.exists(dbname) then
print (dbname .. "already exists, cannot overwrite")
elseif #fs.exists(dbname) then
os.execute("mkdir" .. dbname)
else
print ("something gone wrong in =11")
end
end

function delete_db(dbname)
if fs.exists(dbname) then
fs.delete(dbname)
elseif #fs.exists(dbname) then
print (dbname .. " doesn't exists")
end
end
wolfnether #2
Posted 06 March 2012 - 07:10 PM
at line 31 parenthesis are missing and i son't see other problems
Deathura #3
Posted 06 March 2012 - 07:37 PM
Can you tell in code blocks what you are meaning? Seems like my screen is so wide that it has less than 30 rows :unsure:/>/>

EDIT: problem solved loading new version soon