
Function __Get ( Property_DB ( Any ) As Property_DB_Type, Label As String = EMPTY ) As Property_DB_Type
	__Get = Property_Get ( Property_DB ( ), Label )
	Exit Function
End Function

Function __Set ( Property_DB ( Any ) As Property_DB_Type, Label As String = EMPTY, Value As String = EMPTY ) As Property_DB_Type
	__Set = Property_Set ( Property_DB ( ), Label, Value )
	Exit Function
End Function

Sub __Save ( Property_DB ( Any ) As Property_DB_Type, Filename As String = EMPTY )

	Property_Database_Save ( Property_DB ( ), Filename )

End Sub

Sub __Load ( Property_DB ( Any ) As Property_DB_Type, Filename As String = EMPTY )
	
	Filename = prefix(Property_DB_EXT,Filename) & Property_DB_EXT

	Property_Database_Load ( Property_DB ( ), Filename )

End Sub

function __Query ( Property_DB ( Any ) as Property_DB_Type, Label As String ) As String

	return Label & ":" & QUOT & Property_Database_Query ( Property_DB ( ), Label ).Value & QUOT

end function

function __Echo ( Buffer As String, Caption as String ) As String

	If Buffer NEQ EMPTY Then
		Buffer &= CRLF
	End If

	return Buffer & "--- " & Caption & " ---"

end function

function __Direct ( Property_DB ( Any ) as Property_DB_Type, Property_Echo As String ) As String

	Cls
	
	Property_Echo_Direct ( Property_Database_Export ( Property_DB ( ), Property_Echo ) )
	
	SimpleSleep ( VGA_Table ( ), ESC )
	
	Property_Echo = EMPTY
	
	Return Property_Echo

end function

function __Tinker ( Property_DB ( Any ) As Property_DB_Type, Property_Echo As String, Behavior As String, Label As String, Value As String = EMPTY ) As String

	select case ucwords(Behavior)
	case "Sort":
		
		Property_Echo = __Echo ( EMPTY, "Sorting" )
		__Sort( Property_DB ( ))
		
		return Property_Echo	
	
	case "Add":
		
		Property_Echo = __Echo ( EMPTY, "Adding: " & QUOT & Label & QUOT )
		Property_Database_Set ( Property_DB ( ), Label, Value)

		Value = Property_Get( Property_DB ( ), Label ).Value
		
		return Property_Echo
	
	case "Delete":
		
		Property_Echo = __Echo ( EMPTY, "Deleting: " & QUOT & Label & QUOT )
		Property_Database_Delete( Property_DB ( ), Label )

		Value = EMPTY
		
		return Property_Echo

	case "Retrieve":
		
		Value = Property_Get( Property_DB ( ), Label ).Value
		
		Property_Echo = __Echo ( EMPTY, "Retrieving: " & QUOT & Label & QUOT & COLON & SP & QUOT & Value & QUOT )
		
		return Property_Echo
	
	case else:
		
		Value = EMPTY

		return Property_Echo
	
	end select

end function

/'
function ucwords(Subject As String) As String
	
	Dim As String Buffer = EMPTY
	Dim As String Reserve = Subject
	
	mid(Reserve,1,1) = ucase(mid(Reserve,1,1))
	
	do while len(Reserve) GTR 0
		
		if mid(Reserve,1,1) EQU SP then
			Buffer &= mid(Reserve,1,1)
			Reserve = mid(Reserve,2)
			mid(Reserve,1,1) = ucase(mid(Reserve,1,1))
		else
			Buffer &= mid(Reserve,1,1)
			Reserve = mid(Reserve,2)		
		end if
		
	loop

	return Buffer

end function
'/

function __Bounds ( Property_DB ( Any ) As Property_DB_Type, Property_Echo As String ) As String
	
	Property_Show_Array_Bounds ( Property_DB ( ) )
	SimpleSleep ( VGA_Table ( ), ESC )
	Property_Echo = EMPTY
	
	return Property_Echo
	
end function

function __VideoDirect ( BoardDB ( Any ) As Property_DB_Type, TextureDB ( Any ) As Property_DB_Type, xscan as longint, yscan as longint, by as longint ) As longint

	dim as Property_DB_Type DBBoard, DBTexture
	
	dim as long addr = by\65536
	dim as long x = addr and POSSIXTYTHREE, y = (addr\POSSIXTYFOUR) and POSSIXTYTHREE
	
	'pPix[p].u=point(X,Y,pic(POSONE))
	
	DBBoard=Property_Get( BoardDB(), xscan & COMMA & yscan )
	
	DBTexture=Property_Get( TextureDB(), DBBoard.Value )
	
	return point( x, y, DBTexture.Image)
	
end function

Sub __Sort ( Property_DB ( Any ) As Property_DB_Type )
	
	Property_Bubble_Sort ( Property_DB ( ) )
	
End Sub

