-
Content Count
1406 -
Joined
-
Last visited
-
Days Won
22
Everything posted by programmerdelphi2k
-
just look my sample and use a "FOR"...looping to catch each element from arrary... but you are doing a "recursive called"... then needs some adjusts dont forget: you needs add a FindClose(... sr ) in your code
-
I only reprodure that "asker" have showed in your post... if you want use any other "container", you're free for that!
-
Using inline variables inside loops
programmerdelphi2k replied to havrlisan's topic in RTL and Delphi Object Pascal
firstly, I think that not right way to do it, but, as the var is allocated on stack, and the var-life is "short"! then, the next round, var will "dead", and create a new var on memory same address (if not used yet)! -
procedure MyFindFilePattern(AFolderRoot: string; APatternToSearch: array of string; const AListBox: TListBox); var LSearchRecord: TSearchRec; LIsDirectory : boolean; LContinue : boolean; begin for var LPattern in APatternToSearch do begin LContinue := FindFirst(IncludeTrailingPathDelimiter(AFolderRoot) + LPattern, faAnyFile, LSearchRecord) = 0; // if LContinue then try while LContinue do begin LIsDirectory := ((LSearchRecord.Attr and faDirectory) = faDirectory); // if not((LSearchRecord.Name = '.') or (LSearchRecord.Name = '..')) then begin if LIsDirectory then AListBox.Items.Add('Dir: ' + LSearchRecord.Name) else AListBox.Items.Add('File: ' + LSearchRecord.Name); end; // LContinue := FindNext(LSearchRecord) = 0; end; finally FindClose(LSearchRecord); end; end; end; procedure TForm1.Button1Click(Sender: TObject); begin MyFindFilePattern('d:\MyZip', ['*.zip', '*.txt'], ListBox1); end;
-
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
you should use the version installed when RAD was installed, it's preferible. you can copy from any other PC with RAD 10.4... BUT read the RAD 10.4.x Help about SDK/NDK Android: Android 13 not supported in RAD 10.4 only Android 5.1 to Android 10.0 https://docwiki.embarcadero.com/RADStudio/Sydney/en/Android_Devices_Supported_for_Application_Development https://docwiki.embarcadero.com/RADStudio/Sydney/en/Installing_the_Android_Development_Tools -
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
ok... try as was said before! -
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
SdkManager try UPDATE the packages already downloaded, NOT INSTALL NEW PCKG -
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
always need say where SDK is in! because you can download many others versions u see? -
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
SdkManager download only SDK packages, if need download NDK (if you dont have it) try directly from Google, but remember: Embarcadero dont use the last updates, then use the expected only. https://developer.android.com/ndk/downloads -
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
maybe residual files when using Android Studio, try delete this folder: .Android -
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
if you run SdkMaganer, by default it try updates your files (packages), else you need "say" what install or update... you see? -
for sure, just do it as expected... 😉
-
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
@hackbrew my tip 1: use a "short path to SDK/NDK folders" like: c:\mySDKs\AndroidSDK25 c:\mySDKs\AndroidNDK21 it's more easy to works, including when use SdkManager --sdk_root=.... you see? now, next... set the environment var REPO_OS_OVERRIDE=windows use SDKManager to see what packages YOU HAVE, and what YOU WANT!!! --List / --List_Installed update or install it.... --update / --install try this tips after all, use RAD options to create you new Sdk/Ndk setup. pay attention if you are using the JavaJdk OR AdoptOpenJdk in you "PATH" enviroment variable! -
@robertjohns try this: implementation {$R *.dfm} procedure MyFindFilePattern(AFolderRoot: string; APatternToSearch: string; const AListBox: TListBox); var LSearchRecord: TSearchRec; LIsDirectory : boolean; LContinue : boolean; begin LContinue := FindFirst(AFolderRoot + '\' + APatternToSearch, faAnyFile, LSearchRecord) = 0; try // while LContinue do begin LIsDirectory := ((LSearchRecord.Attr and faDirectory) = faDirectory); // if (LSearchRecord.Name <= '..') then begin LContinue := FindNext(LSearchRecord) = 0; // continue; end; // if LIsDirectory then AListBox.Items.Add('Dir: ' + LSearchRecord.Name) else AListBox.Items.Add('File: ' + LSearchRecord.Name); // LContinue := FindNext(LSearchRecord) = 0; end; finally FindClose(LSearchRecord); end; end; procedure TForm1.Button1Click(Sender: TObject); begin ListBox1.Items.Clear; // ListBox1.Items.Add(' ------ *.* ------'); // MyFindFilePattern('D:\MyZip', '*.*', ListBox1); // ListBox1.Items.Add(' ------ complete filename ------'); // MyFindFilePattern('D:\MyZip', 'MyNewZip.zip', ListBox1); end;
-
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
@hackbrew look, really you dont need Android Studio! then, try this: when you install your RAD, you'll have SDK (almost empty), and NDK (basic content) folders! ok -> BUT, you can "COPY" (this folders it's not really installed by "installer", just unziped) this folders from any PC, just stay alert about version used for each RAD!!! this said, you can copy from another pc (or install a RAD in a VM and copy this 2 folders... later, just delete a new VM) now, in "CMDLINE-TOOLS\bin" folder you have the "SKDManager.bat", if DONT, just download the last version from "cmdline-tools" from Android Studio official site now, just do it as above! -
Custom sort of a TList with object references (works in 32 bit, does not in 64 bit)
programmerdelphi2k replied to Alexander Halser's topic in Algorithms, Data Structures and Class Design
I think that it's NOT expected a pointer here, not? (a pointer is always a number not?) https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Generics.Collections.TList.Sort -
Custom sort of a TList with object references (works in 32 bit, does not in 64 bit)
programmerdelphi2k replied to Alexander Halser's topic in Algorithms, Data Structures and Class Design
@Alexander Halser try this.. uses Generics.Defaults; var intList: TList<Integer>; begin intList := TList<Integer>.Create; try // Add some integer values to the list intList.Add(3); intList.Add(1); intList.Add(7); intList.Add(4); // Sort the list in ascending order intList.Sort(TComparer<Integer>.Construct( function(const Left, Right: Integer): Integer begin if Left < Right then Result := -1 else if Left > Right then Result := 1 else Result := 0; end)); // Do something with the sorted list // ... finally intList.Free; end; end. -
you can just change the COLOR to null color
-
@robertjohns you can test if is a Directory using LIsDirectory := ((FileGetAttr(LFilename) and faDirectory) = faDirectory);
-
here works, at least!
-
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
not problem, see on SDK Manager tab the line SDK API Level, there youchoice what API you can use when compiling... same that your target dont use last version https://docwiki.embarcadero.com/RADStudio/Alexandria/en/SDK_Manager -
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
I think that should be %PATH% or any other environment variable NOT? in fact, you dont need add cmd-tool path on O.S. "PATH' , because that Android use itself vars and setup to find all tools, like do the Delphi when building... of course, you can do it, but it's not really necessary. See the Android.Bat and all batch files called... all it's defined for it. Java/AdoptOpen define its var on O.S. "PATH" var when installed. of course, verify if dont exists more than one on PATH!!! -
As I said above, imagine the scenario: An avid programmer in Delphi, is on a trip, and takes the opportunity to debug his code, and, unfortunately, connects to the public and open Wifi at the train/metro station... he runs his application developed in Delphi CE, and, ... days later, the train/metro company receives a letter from Embarcadero saying that he "must" buy (without delay) a Professional or Enterprise license of Delphi, because it was detected that a Delphi CE application was being used on the day xx/xx/xxxx at xx:xxhr... and the company it's not eligible for $5000/year Isn't this a dire situation caused by Embarcadero's type of marketing?
-
Delphi 10.4.2 add support for Android 13
programmerdelphi2k replied to hackbrew's topic in Cross-platform
As I said: if you used Android Studio to update your SDK/NDK -> you'll have an "incompatibility" if using "MANUAL UPDATES command-line" -> In this case, use "Android Studio" to avoid anything! the Android SDK/NDK can be in any drive or folder, not necessary in C:\Users\Public\ etc.... if using command-line "SDKManager.BAT" first, in your prompt command type this: set REPO_OS_OVERRIDE=windows --> to download only MSWindows O.S. <<Path root of your Android SDK>> = where is the SDK root, in my case it is in: D:\SDKsRAD\AndroidSDK sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --help -> >:_) sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --list_installed -> to see what packages is in your pc! sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --list -> to see what packages is in on Google to download! sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --update "package name" -> to update the package is in your pc! (download from Google) sdkmanager.bat --sdk_root=<<Path root of your Android SDK>> --install "package name" -> to install a new package in your pc! (download from Google) then, a sample in my case: sdkmanager.bat --sdk_root=D:\SDKsRAD\AndroidSDK --install "MyPackXYZ2023" "MyOtherPackABC2024" ... etc... You can download the last "command-line" tools from Android Studio official site, if you need! https://developer.android.com/studio -
Any Demo On How To Use TBiometricAuth In Delphi
programmerdelphi2k replied to stacker_liew's topic in FMX
it was that I said: deprecated!