I'm working on a program similar to the database but I've find out problem I couldn't figure out...
Program should ask for code name (which'll be file name), information about code name, date and time of saving etc. But how I can insert variable in io.open()? Code now looks like this:
...print("Enter command:")print("")if io.read()=="add"thenprint("Enter item location:")
LOC = io.read()
f = io.open("/WH/db/"LOC,"w")--Thisis the problem, LOC (variable,as seen above) should be future file name...print("Enter information:")
CONT = term.read()
f:write(CONT)
f:close()...
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hey there!
I'm working on a program similar to the database but I've find out problem I couldn't figure out...
Program should ask for code name (which'll be file name), information about code name, date and time of saving etc. But how I can insert variable in io.open()? Code now looks like this:
Thanks for help,
Steve505
Link to post
Share on other sites