save point
This commit is contained in:
parent
08ef995805
commit
40ebe8f1c3
3 changed files with 23 additions and 15 deletions
32
kratom.pb
32
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
|
Loading…
Add table
Add a link
Reference in a new issue