diff --git a/kratom.db b/kratom.db
index 99850ec..10b6a1c 100644
Binary files a/kratom.db and b/kratom.db differ
diff --git a/kratom.pb b/kratom.pb
index f8056f1..c00bccc 100644
--- a/kratom.pb
+++ b/kratom.pb
@@ -21,7 +21,7 @@ Openkrt1()
Procedure btn0click (EventType)
;MessageRequester("INFO", "ADD CLICKED")
- DatabaseUpdate(0,"INSERT into kratom (name, type) Values ('"+GetGadgetText(String_0)+"', '"+GetGadgetText(String_1)+"' );")
+ DatabaseUpdate(0,"INSERT into kratom (name, type) Values ('"+Trim(GetGadgetText(String_0))+"', '"+Trim(GetGadgetText(String_1))+"' );")
updatelist()
EndProcedure
@@ -42,18 +42,26 @@ Procedure dellist(EventType)
selectedname$ = GetGadgetItemText(ListView_0,selecteditem)
RemoveGadgetItem(ListView_0,GetGadgetState(ListView_0)) ; removes it from view
fldname$ = StringField(selectedname$,2," ")
-
- ;Debug fldname$
- ;Debug DatabaseUpdate(0, "DELETE FROM kratom WHERE name = '"+fldname$+"';")
+ pos1 = FindString(selectedname$,fldname$,1,#PB_String_NoCase)
+ pos2 = FindString(selectedname$,"Type",1,#PB_String_NoCase) - 6
+ key$ = Mid(selectedname$,pos1,pos2)
+ key$ = Trim(key$)
+ ;Debug "POSES " + pos1 + " " + pos2
+ ;Debug "KEY :" + key$ + ":"
+ ;Debug "FLDNAME " + fldname$
+ ;Debug
+ DatabaseUpdate(0, "DELETE FROM kratom WHERE name = '"+key$+"';")
;Debug DatabaseError()
- ;If DatabaseQuery(0, "DELETE FROM * kratom WHERE name = '"+fldname$+"';")
- ;While NextDatabaseRow(0) ; Loop for each records
- ;Debug GetDatabaseString(#Database, 0) ; Display the content of the first field
- ; AddGadgetItem (ListView_0, -1, "Name " + GetDatabaseString(0,1) + " Type " + GetDatabaseString(0,2))
- ;Wend
- ;EndIf
+
EndProcedure
+Procedure burn()
+
+
+
+EndProcedure
+
+
; window init
updatelist()
@@ -78,8 +86,8 @@ Repeat
Until Event = #PB_Event_CloseWindow ; Quit on any window close
; IDE Options = PureBasic 6.12 LTS (Linux - x64)
-; CursorPosition = 47
-; FirstLine = 24
+; CursorPosition = 54
+; FirstLine = 32
; Folding = -
; EnableXP
; DPIAware
\ No newline at end of file
diff --git a/kratomprj.pbp b/kratomprj.pbp
index 6b60cbe..f645154 100644
--- a/kratomprj.pbp
+++ b/kratomprj.pbp
@@ -7,16 +7,16 @@