hey
hab hier was für euch
ich habs eben in ner stunne gemacht.
Es ist ein Data Base Engine in purem AutoIT gecoded
es ist nicht 100 prozentig fertig, damit ihr auch was dran ändern könnt.
Am besten leßt ihr alles und dann startet ihr mal das sample.
Das ganze funktioniert über Arrays, zum speichern hab ich FileWriteFromArray verwended, was ich aber modifizieren musste, da es nur eine Dimension unterstützt wobei ich 2mal 2 Dimensionen und einmal 3 Dimensionen verwende
Die FileReadToArray Func muss noch gemodded werden.
Dann geht das speichern und auslesen komplett.
Was man noch machen könnte wären ein paar kleine funcs um bestimmte informationen herauszufinden.
Und wer es anpacken möchte : ein DB Editor like NaviCat oder so ^^
das wäre mit der enigine ziemlich einfach x)
ich hab nur grad kopfschmerzen xD
also ich hab das komplette grundgerüst fertig
es is eigentlich sehr schnell.
wenn es komplett seien sollte ( durch eure hilfe ), werd ich dazu nen serverprogramieren und ne udf um auf den server zu connecten und daten zu empfangen.
vllt. noch ne Dll für C++/C# und vB oder so ^^
eLeC BASE
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.1.1 (beta)
Author: Jiyan Akgül
Type: UDF
UDF Name: " eLeC BASE "
About UDF: A DATABASE for every usage and without sepctial types like "int,string,float,double,etc.."
Functions:
'->
#ce ----------------------------------------------------------------------------
#include <File.au3>
#include <Array.au3>
Dim $DATABASE[1001][5002] ; 10.000 Data Bases with 10.000 Tables
Dim $TABLE[5001][1002][2] ; 10.000 Tables for 10.000 Rows
Dim $LINES[5001][1002] ; 10.000 Tabels for 50.000 Lines
Global $DB_ID, $T_ID, $L_ID
Global $DATABASE, $TABLE, $LINES
;;; START SAMPLE >>>>>
;load normaly
_elec_Load()
;add Things
$Test_DB = _elec_CreateDB("Test DB")
$Test_Table = _elec_CreateTable("Test Table")
_elec_CreateRow("Test Row1", $Test_Table, "My Comment")
_elec_CreateRow("Test Row2", $Test_Table, "Only a Test")
_elec_CreateRow("Test Row3", $Test_Table, "Nur ein Test")
$Test_Line = _elec_AddLine($Test_Table, "hi;hey;helo")
;show:
$Read = _elec_ReadLine($Test_Table, $Test_Line)
_ArrayDisplay($Read)
;;; END SAMPLE <<<<<
Func _elec_Load()
$DATABASE[0][0] = 0 ; 0 Databases registred
$TABLE[0][0][0] = 0 ; 0 Tables registret
$LINES[0][0] = 0 ; 0 Lines registred
EndFunc ;==>_elec_Load
Func _elec_Load_FromFile($DB_Link = "elec.db", $T_Link = "elec.t", $L_Link = "elec.l")
_FileReadToArray($DB_Link, $DATABASE)
_FileReadToArray($T_Link, $TABLE)
_FileReadToArray($L_Link, $LINES)
EndFunc ;==>_elec_Load_FromFile
Func _elec_CreateTable($Table_Name, $DB_ID = -1)
If $DB_ID = -1 Then $DB_ID = $DATABASE[0][0]
$DATABASE[$DB_ID][0] = $DATABASE[$DB_ID][0] + 1
$i = $DATABASE[$DB_ID][0]
ConsoleWrite("$i=" & $i & @CRLF)
$TABLE[$i][0][0] = 1
$TABLE[$i][0][1] = $Table_Name
$LINES[$i][0] = 0
Return $i
EndFunc ;==>_elec_CreateTable
Func _elec_CreateRow($Row_Name, $T_ID = -1, $Comment = "")
If $T_ID = -1 Then $T_ID = $TABLE[0][0]
$TABLE[$T_ID][0][0] = $TABLE[$T_ID][0][0] + 1
$LINES[0][0] = $LINES[0][0] + 1
$i = $TABLE[$T_ID][0][0]
$TABLE[$T_ID][$i][0] = $Row_Name
$TABLE[$T_ID][$i][1] = $Comment
Return $i
EndFunc ;==>_elec_CreateRow
Func _elec_AddLine($T_ID, $LINE)
$LINES[0][0] = $LINES[0][0] + 1
$LINES[$T_ID][0] = $LINES[$T_ID][0] + 1
$i = $LINES[$T_ID][0]
$LINES[$T_ID][$i] = $LINE
Return $i
EndFunc ;==>_elec_AddLine
Func _elec_ReadLine($T_ID, $L_ID, $R_ID = 0)
$LINE = StringSplit($LINES[$T_ID][$L_ID], ";")
Local $LINE_[$LINE[0]+1]
If $R_ID = 0 Then
For $i = 1 To $LINE[0]
$LINE_[$i] = $LINE[$i]
Next
Else
$LINE_[0] = $LINE[$R_ID]
EndIf
Return $LINE_
EndFunc ;==>_elec_ReadLine
Func _elec_ReplaceLine($L_ID, $LINE)
$LINES[$T_ID][$L_ID] = $LINE
EndFunc ;==>_elec_ReplaceLine
Func _elec_CreateDB($DB_Title)
$DATABASE[0][0] = $DATABASE[0][0] + 1
$i = $DATABASE[0][0]
$DATABASE[$i][0] = 1
$DATABASE[$i][1] = $DB_Title
Return $i
EndFunc ;==>_elec_CreateDB
Func _elec_ListDB()
$j = $DATABASE[0][0]
Local $ListArr_DB[$j + 1][2]
$ListArr_DB[0] = $j
For $i = 1 To $j
$ListArr_DB[$i][0] = $DATABASE[$i][0]
$ListArr_DB[$i][1] = $DATABASE[$i][1]
Next
Return $ListArr_DB
EndFunc ;==>_elec_ListDB
Func _elec_Save($DB_Link = "elec.db", $T_Link = "elec.t", $L_Link = "elec.l")
_FileWriteFromArray_1($DB_Link, $DATABASE)
_FileWriteFromArray_2($T_Link, $TABLE)
_FileWriteFromArray_1($L_Link, $LINES)
EndFunc ;==>_elec_Save
;;;; NEEEDED AND MODDED FUNCS
; #FUNCTION# ====================================================================================================================
; Name...........: _FileWriteFromArray <<<modded for 2 DIMENSIONS>>>
; Author ........: Jos van der Zande <jdeb at autoitscript dot com>
; Modified.......: Updated for file handles by PsaltyDS at the AutoIt forums.
; ===============================================================================================================================
Func _FileWriteFromArray_1($File, $a_Array)
; Check if we have a valid array as input
If Not IsArray($a_Array) Then Return SetError(2, 0, 0)
; Open output file for overwrite by default, or use input file handle if passed
Local $hFile
If IsString($File) Then
$hFile = FileOpen($File, 2)
Else
$hFile = $File
EndIf
If $hFile = -1 Then Return SetError(1, 0, 0)
; Write array data to file
Local $ErrorSav = 0
For $x = 0 To UBound($a_Array)-1
For $y = 0 To UBound($a_Array, 2)-1
If FileWrite($hFile, $a_Array[$x][$y] & @CRLF) = 0 Then
$ErrorSav = 3
ExitLoop
EndIf
Next
Next
; Close file only if specified by a string path
If IsString($File) Then FileClose($hFile)
; Return results
If $ErrorSav Then
Return SetError($ErrorSav, 0, 0)
Else
Return 1
EndIf
EndFunc ;==>_FileWriteFromArray_1
; #FUNCTION# ====================================================================================================================
; Name...........: _FileWriteFromArray <<<modded for 3 DIMENSIONS>>>
; Author ........: Jos van der Zande <jdeb at autoitscript dot com>
; Modified.......: Updated for file handles by PsaltyDS at the AutoIt forums.
; ===============================================================================================================================
Func _FileWriteFromArray_2($File, $a_Array)
; Check if we have a valid array as input
If Not IsArray($a_Array) Then Return SetError(2, 0, 0)
; Open output file for overwrite by default, or use input file handle if passed
Local $hFile
If IsString($File) Then
$hFile = FileOpen($File, 2)
Else
$hFile = $File
EndIf
If $hFile = -1 Then Return SetError(1, 0, 0)
; Write array data to file
Local $ErrorSav = 0
For $x = 0 To UBound($a_Array)-1
For $y = 0 To UBound($a_Array, 2)-1
For $z = 0 to UBound($a_Array,3)-1
If FileWrite($hFile, $a_Array[$x][$y][$z] & @CRLF) = 0 Then
$ErrorSav = 3
ExitLoop
EndIf
Next
Next
Next
; Close file only if specified by a string path
If IsString($File) Then FileClose($hFile)
; Return results
If $ErrorSav Then
Return SetError($ErrorSav, 0, 0)
Else
Return 1
EndIf
EndFunc ;==>_FileWriteFromArray_1
Alles anzeigen
have fun ;)
gez :: *electriZer*