Single or Stand-alone table (part 7)
This brings up to the Delete Procedure, and the DeleteValidate Procedure. These we will explain in this post. Just as the Save Procedure call a Validate Procedure, so the Delete Procedure call a DeleteValidate Procedure. In this manner you can easily insert code to ensure the record being deleted is not being "used" or referenced elsewhere in your application. The Delete itself is very straight forward. Procedure.i Delete(*Class.FighterSize) Protected Result, DBID Protected Sql$ If DeleteValidate(*Class) = #False ProcedureReturn #False Else DBID = DB::Open(DBTYPE::#Sqlite) SetDatabaseLong(DBID, 0, *Class\ID) Sql$ = " DELETE " Sql$ = Sql$ + "FROM " Sql$ = Sql$ + "FighterSize " Sql$ = Sql$ + "WHERE " Sql$ = Sql$ + "ID = ? " Result = DB::Update(DBID, Sql$) DB::Close(DBID) ProcedureReturn Result EndIf If the Record is approved for del...