Jump to content

William23668

Members
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. William23668

    Unable to create sqlite database at runtime with firedac

    wow this solved the problem, I never read about this parameter before. many thanks
  2. William23668

    Unable to create sqlite database at runtime with firedac

    I dont understand !! the code display error on connect so it does not connect or create a file.
  3. Hi I am using this code to create the database bute I get error on connect : var MyDBFile: string; begin MyDBFile := 'C:\db5.sqlite3'; if FileExists(MyDBFile) then DeleteFile(MyDBFile); FDConnection1.Params.Values['Database'] := MyDBFile; FDConnection1.Params.Values['DriverID'] := 'SQLite'; //Connection.Params.Values['Encrypt'] := 'aes-128'; //Connection.Params.Values['Password'] := '1234'; FDConnection1.Connected := True; --------------------------- [FireDAC][Phys][SQLite] ERROR: unable to open database file. ---------------------------
  4. William23668

    stringreplace character in all string

    No it was just to practice.
  5. William23668

    stringreplace character in all string

    love you. many thanks
  6. William23668

    stringreplace character in all string

    I test it with this line fstr := 'MZ'#$0090#0#3#0#0#0#4#0#0#0'ÿÿ'#0#0'¸'#0#0#0#0#0#0#0''; fstr := stringreplace(fstr,'#0','0',[rfReplaceAll, rfIgnoreCase]); output is (copied from the watch window) 'MZ'#$0090#0#3#0#0#0#4#0#0#0'ÿÿ'#0#0'¸'#0#0#0#0#0#0#0
  7. I have string like this 84@fgl#000^2#0#0 94j@f#0 And I tried to replace all '#0' with '0' like this result := stringreplace(OriginalStr, '#0', '0',[rfReplaceAll, rfIgnoreCase]); But this did not replace all the '#0' , how I should use this ?
  8. William23668

    Reading a binary file hangup without error

    Ok learning now about encoding.
  9. William23668

    Reading a binary file hangup without error

    Just for learning why the app stop responding ? if I used richedit LoadFromStream it load fine.
  10. William23668

    Reading a binary file hangup without error

    @Remy Lebeau Many thanks I learned many things now. I just need to read byte by byte for processing later.
  11. Hi I was able to read the file byte by byte but the app hangup/not responding I dont know why ? Here is the code: var AFile: TFileStream; BR: TBinaryReader; MyByteArray: TBytes; mstr: String; i: integer; begin AFile := TFileStream.Create(filename, fmOpenRead); BR := TBinaryReader.Create(AFile, TEncoding.Unicode, false); try SetLength(MyByteArray, AFile.Size); // Get the whole file contents into the byte array MyByteArray := BR.ReadBytes(AFile.Size); for i := low(MyByteArray) to High(MyByteArray) do begin SetString(mstr, PAnsiChar(@MyByteArray[i]), Length(MyByteArray)); RichEdit1.Text := RichEdit1.Text + mstr; end; BR.Close; finally BR.Free; AFile.Free; end; end;
  12. William23668

    How to set TBytes array to the file size ?

    Appreciate your help friend.
  13. William23668

    How to set TBytes array to the file size ?

    thanks alot. I can not open this url, does it work with you ?
  14. William23668

    How to set TBytes array to the file size ?

    for example hex editor it display address and value ?
×