Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

10 Good

1 Follower

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

52 profile views
  1. emailx45

    getting started question: ToGo or Local

    First, I would try alternatives to regularize the performance of your network, which, I think is for internal use, and, perhaps with external connectivity to the internet. Well, in this case, a good option would be to reevaluate your network server, I think it is badly configured, and, at worst, congested. If congested, a new hardware upgrade plan may be needed! There is also, on the notebook side (clients), the possibility of having a network card in the "Megabits" standard, and today everything revolves around "Gigabits", even if using Wifi instead of standard cabling. In this case, it would be necessary to exchange the network cards for more updated cards, if this is the current design. To remedy, or at least, remove any doubts about the performance of the local network among notebooks (clients), removing them from the main network, to test performance. Now, if the clients' performance proves to be adequate when exchanging data (files, etc ...), then it is confirmed that the bottleneck is in your server, where they are currently connected. One of the causes of its loss of performance, may be precisely, the access to the internet by the data server, since it will always be consulting it at all times, and Interbase may be doing the same thing. Thus, this can influence the demand for data services. Clearly, you need to divide the jobs: have a server with internet access (which can be released to all computers and devices of interest) have a server with access to the Database Interbase (out of reach of the internet). This way, you would have a local subnet, for the Database, and a general network for external access (internet) for example. Some like this: with 2 hubs (basic) and 1 switcher, you will have this design in action! Hub 1 = 192.168.1.x Hub 1 = 192.168.2.x Switcher (192.168.3.x) "join" Hub 1 + Hub 2 address ===> on Switcher, you can create "Virtual Nets" and give access to your servers (Database and Internet) Good site for study about networks: https://sourcedaddy.com/networking/extending-the-network-with-multiple-hubs.html To join the two subnets, you could use a "switcher" (preferably, as it is specific to this) or a "hub" with the option to concatenate the two networks. Regarding your application with access to Interbase, please be aware that the RAD Studio Enterprise / Architect edition provides a limited license for use in "development", for use in "production" it is necessary that each customer has their license installed. For more details, see the Embarcadero website on this subject. The license for IBtoLite / IBtoGo is for exclusive access to a Database, not for multi-users! https://www.embarcadero.com/interbase-licensing-options Developer Edition Licensing InterBase Developer Edition allows software developers to freely develop InterBase applications before they deploy them. All the functionality of InterBase Server Edition is included with Developer Edition. Additional InterBase Licensing Information You must purchase a Desktop license for each Desktop edition you plan to deploy. You must purchase a ToGo license for each ToGo edition you plan to deploy. An InterBase Server License activates the InterBase Server software and a license for 1 User connection or for the number of users based on the volume license purchased. InterBase Server Edition licenses include support for up to 8 CPU cores. To add support for more than 8 cores on a single machine, additional licenses are required. To purchase additional simultaneous user licenses to an existing InterBase Server installation, additional Simultaneous User Licenses can be purchased in the same quantities listed above to allow additional users to connect. Each Simultaneous User License consists of a license certificate with a serial number. Entering and registering the serial number using the InterBase License Manager will add additional simultaneous user connections to the InterBase Server. In your RAD install, you have in (Samples folders) ...\Object Pascal\Database = FireDAC and Interbase Demo for tests!
  2. emailx45

    Problem with BidiMode

    NOTE: my MSWindows is in Portuguese-Brazil and I dont have any other language installed Some languages do not follow the left to right reading order commonly found in Western languages, but rather use the right to left reading order for words and the left to right reading order for numbers. These languages are termed bi-directional (BiDi) because of this separation. The most common bi-directional languages are Arabic and Hebrew, although other Middle East languages are also bi-directional. The VCL supports bi-directional localization through the BiDiMode and ParentBiDiMode properties. TApplication has two properties, BiDiKeyboard and NonBiDiKeyboard, that allow you to specify the keyboard layout. implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var lX_Position: integer; begin { Specifies the bidirectional mode for the control. Use BiDiMode to enable the control to adjust its appearance and behavior automatically when the application runs in a locale that reads ... from right to left instead of left to right. The bidirectional mode controls the reading order for the text, the placement ... of the vertical scroll bar, and whether the alignment is changed. Alignment does not change for controls that are known to contain number, date, time, or currency values. For example, with data-aware controls, ... the alignment does not change for the following field types: ftSmallint, ftInteger, ftWord, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ... ftDateTime, ftAutoInc. } // ListBox1.BiDiMode := TBiDiMode.bdLeftToRight; ListBox1.BiDiMode := TBiDiMode.bdRightToLeft; // ListBox1.BiDiMode := TBiDiMode.bdRightToLeftNoAlign; // ListBox1.BiDiMode := TBiDiMode.bdRightToLeftReadingOnly; // ListBox1.Items.Add('مرحبا العالم القاسي'); ListBox1.Items.Add('هل هم بشر من أي وقت مضى؟'); // Edit1.BiDiMode := TBiDiMode.bdRightToLeft; Edit1.Text := 'مرحبا العالم القاسي'; // Edit1.Text := '123 SAMPLE 456'; // Label1.BiDiMode := Edit1.BiDiMode; Label1.Caption := Edit1.Text; // lX_Position := (Edit1.Left + Edit1.Width) - Self.Canvas.TextWidth(Edit1.Text); // Self.Canvas.Font.Orientation := -180 * 10; Self.Canvas.Font.Color := clBlue; // Self.Canvas.TextOut(lX_Position { x } , 270 { y } , Edit1.Text); // Rotation works in tenths of the angle reported, then: (Angle * 10) = your rotation // Horizontal to Right = (0 * 10) // Vertical to Down = (-90 * 10) // Horizontal to Left = (-180 * 10) // Vertical to Up = (90 * 10) end; hug
  3. emailx45

    String into TArray<Byte>

    In my opinion: "Better", it is one that works for the purpose for which it was designed, and, for now, the system in use has not yet exploded! 😂😂😂😂 // to verify: caption := TEncoding.Default.ToString; caption := TEncoding.Default.EncodingName; caption := TEncoding.Default.IsSingleByte.ToString(false or true); // see System.SysUtils.BoolToStr caption := TEncoding.Default.IsStandardEncoding(TEncoding.Unicode).ToString(false or true); // see System.SysUtils.BoolToStr /// etc...
  4. emailx45

    Problem with BidiMode

    http://docwiki.embarcadero.com/RADStudio/Sydney/en/Including_Bi-directional_Functionality_in_Applications How should BiDi work? This table shows all the different combinations of BiDiMode with Horizontal Alignment. The table reflects the behavior of Delphi's VCL controls, and uses Delphi's terminology for BiDiMode settings. The example is given with Hebrew words and punctuation marks, in order to give a realistic demonstration of BiDi behavior. For those interested, the first phrase means "Not good...", the second means "Excellent!", and the third means "Alright;". BiDiMode H.Alignment Action Comments Example bdLeftToRight (No BiDi support) None, Left Align text to left Note that the ellipsis (...) is on the wrong side of the text. לא טוב... Center Center text לא טוב... Right Align text to right לא טוב... bdRightToLeft (Full BiDi support) None, Left Align text to right The exclamation mark (!) is on the correct side of the word. The alignment is opposite to the direction that is actually specified in H.Alignment. מצויין! Center Center text מצויין! Right Align text to left מצויין! bdRightToLeftNoAlign, bdRightToLeftReadingOnly (Partial BiDi support) None, Left Align text to left The semicolon (;) is on the correct side of the word. The alignment is as specified in H.Alignment. בסדר; Center Center text בסדר; Right Align text to right בסדר; source: https://reportman.sourceforge.io/doc/bidi_behavior.html
  5. emailx45

    String into TArray<Byte>

    maybe that way be more clear and usual! - NOTE: not valid to CharSet like Chinese text, for example = UCS2 or UCS4! RAD Studio 10.3.3 Arch (RIO) VCL project for test] implementation {$R *.dfm} procedure TForm1.btn_String_To_TArrayByteClick(Sender: TObject); var lMyTArrayByte: TArray<Byte>; begin Edit1.Text := Trim(Edit1.Text); // elimated all spaces: left and right text! // if (Edit1.Text = EmptyStr) then begin ShowMessage('Edit.Text = empty'); exit; end; // // Call BytesOf to convert a string or a character into an array of bytes. // Unicode strings and WideStrings are converted using the default system locale represented by the Default property of the TEncoding class. // lMyTArrayByte := BytesOf(Edit1.Text); // TEncoding.Default.GetBytes(Val); // // Call ByteLength to obtain the size of a string in bytes. // ByteLength calculates the size of the string by multiplying the number of characters in that string to the size of a character. // For example, for the string "John", ByteLength returns 8. // ShowMessage( { } Format('ByteLength = %d (= Total Div 2 = %d), Char=%s, WideChar=%s', [ { } ByteLength(Edit1.Text), { } ByteLength(Edit1.Text) div 2, { } Char(lMyTArrayByte[0]), {WideChar(lMyTArrayByte[0]) } ]) { } ); // // Char() Represents a word-sized (16-bits) character type. // Char is the equivalent of the WideChar type (because the default string type is UnicodeString). // The implementation of Char may be changed in future releases // end; hug
  6. This Sections is always used to initialize/register class etc... in OP. you can have in any unit, and it is executed according with calls order in your projects. always before any others units without it, or on finaly when end your app. Delphi use it in many units (~895units in RAD Studio 10.3.3 Arch in source codes) It is not just an "adornment" in the code, but an important section, after "Interface" and "Implementation", properly! Widely used in "FireDAC", for example! All_Units_Using_INITIALIZATION_and_FINALIZATION_Sections.txt
  7. and "IF" you use it that way: RAD Studio 10.3.3 Arch sample aSTR.Lenght --> using Helper class for Strings var Form1: TForm1; implementation {$R *.dfm} // const OR var bFlag: boolean = true; // if needs change it function ProcessStringOLD(const aStr: string): string; begin Result := aStr; // // Result := Result + ' new value '; // NO NEEDS any "local" var! // if (Result.Length = 1) then Result := aStr; end; function ProcessStringNew(const aStr: string): string; begin try if bFlag then Exit(aStr); // Result := ProcessStringOLD(aStr); // finally Form1.Caption := Result; end; end; procedure TForm1.Button1Click(Sender: TObject); begin ProcessStringNew('h'); end; initialization // is executed before many unit (yours) bFlag := false; finalization end. hug
  8. emailx45

    No C/S FireDac for Delphi Professional

    Here my testimonial about FireDAC and RAD Studio not Enterprise or Architect use: I DID the INSTALLATION OF FireDAC (from RAD Studio v10.3.0) in the RAD Studio CUMUNITY EDITION v10.3.0. was necessary 390MB of files! Then, it is possible to use FireDAC in a non-Enterprise or Architect edition. Since the EC is the old PROFESSIONAL with changes, naturally, then, perhaps, it is also possible to do this same installation.
  9. emailx45

    [Firedac] SQLServer Table Locked

    Basic components or objects to use with FireDAC or any other similar: FDGUIxWaitCursor -- Use TFDGUIxWaitCursor to add the IFDGUIxWaitCursor interface implementation to your application. This implementation is mandatory for FireDAC applications. FDPhysXXXXXXXXDriverLink -- to access your DB internal command / appropriated for each DB FDConnection -- to define the string connection and others params FDTransaction -- preference 2 components = 1 for READ-ONLY (selects) and 1 for READ-WRITE (updates / deletes) for example! FDConnection.Transaction = FDTransactionREADONLY component = [ ReadCommitted ] to "see" the updates from another users! FDConnection.UpdateTransaction = FDTransactionREADWRITE component = [ ReadCommitted ] when you dont use any component/object for Transaction, you force the FireDAC to use the "internal" transaction components -- managed by FireDAC! when you use "your" TRANSACTION components, you are responsable by him! -- if you active, then, you deactive! (create/free/ etc...)
  10. emailx45


    and now, my code can be used or not? NOTE: 100.000.000 it's enought! EOUTMemory! --- Im using 2 Array dynamic :)))) Intel i7 4770K (4 x 8 cpus at stock) RAM 16GB at 1600MHz test in DEBUG mode unit uFormMain; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm1 = class(TForm) btn_Creating_Hex_Randoms: TButton; btn_Convert_HexToBin_Values: TButton; mmMyMemoLog: TMemo; edtTotalArraysToHexValues: TEdit; edtCreatingHexValuesRandomic: TEdit; Label1: TLabel; edtConvertingHexValueToBin: TEdit; btn_Showing_HexValues_In_Arrays: TButton; edtShowingHexValuesAndBinInArrays: TEdit; btn_STOP_ME_PLEASE: TButton; procedure btn_Creating_Hex_RandomsClick(Sender: TObject); procedure btn_Convert_HexToBin_ValuesClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure btn_Showing_HexValues_In_ArraysClick(Sender: TObject); procedure btn_STOP_ME_PLEASEClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses System.Diagnostics; const lTotalHexGenerated: integer = 1000000; // 1.000.000 Hex values for tests!!! lHexChars: array [0 .. 15] of char = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); lBinValues: array [0 .. 15] of Ansistring = ('0000', '0001', '0010', '0011', '0100', '0101', '0110', '0111', '1000', '1001', '1010', '1011', '1100', '1101', '1110', '1111'); var lArraysWithMyHexGenerated: array of string; lArraysWithMyBinGenerated: array of string; // lMyStopWatch: TStopwatch; lCounter : integer; function fncMyHexToBin(const lHexValue: string): string; var lEachHexChar: char; begin Result := ''; // for lEachHexChar in lHexValue do // now, ONLY HexChars in const it should be accepted, as expected! But, Im not verifying here for while! // // now is not necessary verify the exception... for while!!! // try Result := Result + lBinValues[Pos(lEachHexChar, lHexChars) - 1]; // except // case the "char" is not found, we have a "AV"! then.... doesnt matter for us! // end; end; procedure TForm1.btn_Creating_Hex_RandomsClick(Sender: TObject); var i : integer; z : integer; lNewHexString: string; begin lNewHexString := ''; // if (high(lArraysWithMyHexGenerated) = -1) then begin ShowMessage('lArraysWithMyHexGenerated = 0 values generated'); exit; end; // mmMyMemoLog.Clear; // Randomize; // lMyStopWatch := TStopwatch.StartNew; // try // for i := 0 to Pred(lTotalHexGenerated) do begin for z := 1 to 8 do lNewHexString := lNewHexString + lHexChars[(Random(high(lHexChars)) + 1)]; // lArraysWithMyHexGenerated[i] := lNewHexString; // lNewHexString := ''; // // Memo1.Lines.Add(i.ToString + ' - ' + lArraysWithMyHexGenerated[i]); end; // finally lMyStopWatch.Stop; // edtCreatingHexValuesRandomic.Text := Format('[%d] was created in [%d]ms', [lTotalHexGenerated, lMyStopWatch.ElapsedMilliseconds]); end; end; procedure TForm1.btn_Showing_HexValues_In_ArraysClick(Sender: TObject); var i: integer; begin if (high(lArraysWithMyHexGenerated) = -1) then begin ShowMessage('lArraysWithMyHexGenerated = 0 values generated'); exit; end; // mmMyMemoLog.Clear; // lMyStopWatch := TStopwatch.StartNew; // try // for lCounter := 0 to Pred(lTotalHexGenerated) do begin mmMyMemoLog.Lines.Add(lCounter.ToString + ' - ' + lArraysWithMyHexGenerated[lCounter] + ' - ' + lArraysWithMyBinGenerated[lCounter]); // Application.ProcessMessages; // if (lCounter = lTotalHexGenerated) then // forcing a "stop!" exit; end; // finally lMyStopWatch.Stop; // edtShowingHexValuesAndBinInArrays.Text := Format('[%d] Showing Hex and Bin on MemoLog in [%d]ms', [lTotalHexGenerated, lMyStopWatch.ElapsedMilliseconds]); end; end; procedure TForm1.btn_STOP_ME_PLEASEClick(Sender: TObject); begin lCounter := lTotalHexGenerated; // forcing a "stop!" end; procedure TForm1.FormCreate(Sender: TObject); begin edtTotalArraysToHexValues.Text := FormatFloat('###,###,###,###,##0', high(lArraysWithMyHexGenerated) + 1); end; procedure TForm1.btn_Convert_HexToBin_ValuesClick(Sender: TObject); var i: integer; begin if (high(lArraysWithMyHexGenerated) = -1) then begin ShowMessage('lArraysWithMyHexGenerated = 0 values generated'); exit; end; // lMyStopWatch := TStopwatch.StartNew; // try // for i := 0 to Pred(lTotalHexGenerated) do begin lArraysWithMyBinGenerated[i] := fncMyHexToBin(lArraysWithMyHexGenerated[i]); // // Memo1.Lines.Add(i.ToString + ' - ' + fncMyHexToBin(lArraysWithMyHexGenerated[i])); end; // finally lMyStopWatch.Stop; // edtConvertingHexValueToBin.Text := Format('[%d] HexString was converted in Bin in [%d]ms', [lTotalHexGenerated, lMyStopWatch.ElapsedMilliseconds]); end; end; initialization ReportMemoryLeaksOnShutdown := true; // SetLength(lArraysWithMyHexGenerated, lTotalHexGenerated); // if low memory = EOutOfMemory exception! // SetLength(lArraysWithMyBinGenerated, lTotalHexGenerated); // if low memory = EOutOfMemory exception! finalization end. hug
  11. emailx45

    TBluetoothLE in Windows 10

    The WinSoft it's a company that have "many mini-components" for all platforms by RAD Studio last, but dont have any for MSWindows Bluetooth. https://winsoft.sk/products.htm nSoftwares: (Available in all major Windows development environments) - We offer free, fully-functional 30-day trials https://www.nsoftware.com/ipworks/ble/ https://www.serialio.com/support/bluesnap/windows/how-pair-bluesnap-smart-windows-10-ble Here, a project by Fernando Rizzato (MVP Leader from South America) Chat via Bluetooth for Android, macOS and Windows (in Portuguese-BR) https://fernandorizzato.com/2017/04/20/um-chat-via-bluetooth-para-android-macos-e-windows/ Download sources at: https://cc.embarcadero.com/item/30766 Developer Skill Sprint: Spelunking Bluetooth Low Energy Devices https://community.embarcadero.com/blogs/entry/developer-skill-sprint-spelunking-bluetooth-le (In Windows * * Bluetooth (LE) must be coupled with the device manager (in German) https://www.delphipraxis.net/189298-bluetooth-low-energy-delphi-6-a-3.html
  12. emailx45

    Another getit problem for rad 10.4.1

    did you try by official page https://getitnow.embarcadero.com install your components?
  13. emailx45

    Reversing from CloneCursor method

    este procedimento pode fazer o trabalho mais rápido: // ... a estrutura deve ser a mesma no final !!! FDQuery1.AttachTable (FDMemTable1.Table, nil); FDTable1.AttachTable (FDMemTable1.Table, nil); FDMemTable1.AttachTable (FDMemTable1.Table, nil); ... talvez um FDQuery1. "CLOSE" pode ajudá-lo, a começar um novo anexo look at: unit FireDAC.Comp.DataSet.pas, line 7322 and see "AttachTable in use" by "CloneCursor" veja se te ajuda! abraço
  14. emailx45

    Attach tFDmemTables to memory sqlite database

    see if my samples help you, here using SQLite driver on "memory" database ==> :memory: on two FDConnnection components, but you can use DB distincts, as you desire! IMPORTANT: Datasets with "unique names" in all system the order of open can necessary to avoid "AV" when creating by code is necessary add (register) the "datasets" with "names" on LocalSQL component - see on Help System! when open this project you can see some "errors", but is because the components is defined as "open" by default here! just close all datasets, LocalSQL and FDConns using FDMemTables, you needs save the "structure", firstly to use in LocalSQL - of course, already in tables, the structures already is saved on Database file! RAD Studio 10.3.3 Arch VCL project in 32bits Form components: Project source VCL_LocalSQL_and_FDMemTable_FDQuery_2_FDConnection_SQLite_DB_in_Memory.zip hug
  15. emailx45

    TBluetoothLE in Windows 10

    maybe help you http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_Bluetooth_Low_Energy HELP SYSTEM: Platform Support Platform Bluetooth Low Energy Client Server Windows(*) 10+ 10+ (**) macOS 10.7+ 10.9+ iOS 5+ 6+ Android 4.3+ 5+ Note: Windows Server does not support Bluetooth, see General Bluetooth Support in Windows. Note: WinRT Bluetooth API provides support for BLE advertising data through the manufacturer-specific data field, but it does not fully implement GATT Server functionalities. Note: The iOS property list includes configuration for Bluetooth LE. Attention: Applications running on Windows platform lower than Windows 10 do not support Bluetooth LE. Place a TBluetoothLE Component Use the new TBluetoothLE component to implement the RTL BluetoothLE feature for server and client applications. TBluetoothLE includes the System.Bluetooth unit in your application and internally calls TBluetoothLEManager.Current to get an instance of TBluetoothLEManager. TBluetoothLEManager is the main class for Bluetooth Low Energy communications. Note: TBluetoothLEManager.Current always returns the same instance of TBluetoothLEManager. You do not need more than one instance of TBluetoothLEManager. Discovering Devices BluetoothLE does not work as the Classic Bluetooth, you do not need to pair the devices. BluetoothLE clients need to discover BluetoothLE servers. Notes: Applications running on Windows platform lower than Windows 10 need to pair the devices before discovering BluetoothLE servers. For more information, see Windows Bluetooth FAQ. The WinRT API for Windows 10+ platforms allows to scan for devices without the need to pair them. Use the DiscoverDevices method to discover BluetoothLE servers. procedure DoScan; const HeartRateService: TBluetoothUUID = '{0000180D-0000-1000-8000-00805F9B34FB}'; begin BluetoothLE1.DiscoverDevices(2500) // The parameter is the timeout in milliseconds. BluetoothLE1.DiscoverDevices(2500, [HRService]) // It only exposes devices with the Heart Rate service to the BluetoothLE client. end; After this period of time, the OnEndDiscoverDevices event is fired. Once you discovered the device you can start getting the services and characteristics from the standard profile as outlined below.