Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Commit 3cbebbf

Browse files
authored
added tags and other changes regarding file:write()
1 parent 32f5735 commit 3cbebbf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.app/todoList.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ local function addTask()
1313
local priority = io.read("*line")
1414
if priority == "" then priority = nil end
1515

16+
io.write("Lables: ")
17+
local lables = io.read()
18+
1619
io.write("Subtasks (separated by commas): ")
1720
local subtasksStr = io.read("*line")
1821
local subtasks = {}
@@ -33,14 +36,18 @@ local function addTask()
3336

3437
local file = io.open("taskList.txt", "a")
3538

39+
file:write("\n")
3640
file:write("-------New Task -----" .. "\n")
3741
file:write("Task name: " .. task .. "\n")
3842
file:write("Due date: " .. (dueDate or "") .. "\n")
3943
file:write("Priority: " .. (priority or "") .. "\n")
44+
file:write("Lables: " .. lables .. "\n")
4045
file:write("Sub tasks: " .. (subtasksStr or "") .. "\n")
4146
file:write("Date added: " .. os.date('%m-%d-%Y %H:%M:%S') .. "\n")
47+
file:write("\n")
4248

4349
file:close()
50+
print("") -- spacer
4451
print("Task added! Check the explorer for: taskList.txt")
4552
end
4653

0 commit comments

Comments
 (0)