Jump to content

Search the Community

Showing results for tags 'delphi'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 226 results

  1. I have a problem with Delphi Alexandria and it's JSON methods, maybe I just do it wrong and would like to get help. Here is my demo project that show the problem. program Project12; {$APPTYPE CONSOLE} {$R *.res} uses Winapi.Windows, System.Classes, System.SysUtils, System.IOUtils, System.JSON; type TMyJsonRec = packed record MyInteger: Integer; MyInt64: Int64; MyUInt64: UInt64; MyDWORD: DWORD; MyDouble: Double; MyBoolean: Boolean; MyString: string; end; procedure SaveJsonToFile(const AJsonObject: TJSONObject; const AFileName: string); var JsonText: string; StreamWriter: TStreamWriter; begin JsonText := AJsonObject.ToString; // is this the problematic part? StreamWriter := TStreamWriter.Create(AFileName, False, TEncoding.UTF8); try StreamWriter.Write(JsonText); finally StreamWriter.Free; end; end; procedure SaveRecordToJson(const ARecord: TMyJsonRec; const AFileName: string); var JsonObject: TJSONObject; begin JsonObject := TJSONObject.Create; try JsonObject.AddPair('MyInteger', TJSONNumber.Create(ARecord.MyInteger)); JsonObject.AddPair('MyInt64', TJSONNumber.Create(ARecord.MyInt64)); JsonObject.AddPair('MyUInt64', TJSONNumber.Create(ARecord.MyUInt64)); // this does not work as I would have thought it does, when it exceed Int64 range it break JsonObject.AddPair('MyDWORD', TJSONNumber.Create(ARecord.MyDWORD)); JsonObject.AddPair('MyDouble', TJSONNumber.Create(ARecord.MyDouble)); JsonObject.AddPair('MyBoolean', TJSONBool.Create(ARecord.MyBoolean)); JsonObject.AddPair('MyString', ARecord.MyString); SaveJsonToFile(JSonObject, AFileName); finally JsonObject.Free; end; end; function LoadRecordFromJson(const AFileName: string): TMyJsonRec; var JsonObject: TJSONObject; begin JsonObject := TJSONObject.ParseJSONValue(TFile.ReadAllText(AFileName)) as TJSONObject; try Result.MyInteger := JsonObject.GetValue('MyInteger').AsType<Integer>; Result.MyInt64 := JsonObject.GetValue('MyInt64').AsType<Int64>; Result.MyUInt64 := JsonObject.GetValue('MyUInt64').AsType<UInt64>; // this does not work as I would have thought it does, when it exceed Int64 range it break Result.MyDWORD := JsonObject.GetValue('MyDWORD').AsType<DWORD>; Result.MyDouble := JsonObject.GetValue('MyDouble').AsType<Double>; Result.MyBoolean := JsonObject.GetValue('MyBoolean').AsType<Boolean>; Result.MyString := JsonObject.GetValue('MyString').Value; finally JsonObject.Free; end; end; var MyRecord1, MyRecord2: TMyJsonRec; begin // Initialize the record MyRecord1.MyInteger := High(Integer); MyRecord1.MyInt64 := High(Int64); MyRecord1.MyUInt64 := High(UInt64); MyRecord1.MyDWORD := High(DWORD); MyRecord1.MyDouble := 123.456; MyRecord1.MyBoolean := True; MyRecord1.MyString := 'Hello, World!'; Writeln('Original record:'); Writeln('MyInteger: ', MyRecord1.MyInteger); Writeln('MyInt64: ', MyRecord1.MyInt64); Writeln('MyUInt64: ', MyRecord1.MyUInt64); Writeln('MyDWORD: ', MyRecord1.MyDWORD); Writeln('MyDouble: ', MyRecord1.MyDouble); Writeln('MyBoolean: ', MyRecord1.MyBoolean); Writeln('MyString: ', MyRecord1.MyString); SaveRecordToJson(MyRecord1, '.\test.json'); MyRecord2 := LoadRecordFromJson('.\test.json'); // Output the loaded record Writeln('Loaded record:'); Writeln('MyInteger: ', MyRecord2.MyInteger); Writeln('MyInt64: ', MyRecord2.MyInt64); Writeln('MyUInt64: ', MyRecord2.MyUInt64); Writeln('MyDWORD: ', MyRecord2.MyDWORD); Writeln('MyDouble: ', MyRecord2.MyDouble); Writeln('MyBoolean: ', MyRecord2.MyBoolean); Writeln('MyString: ', MyRecord2.MyString); ReadLn; end. I am unsure if it is the saving part or the reading part.
  2. I found some nice Python code on WWW.SBERT.NET that perfectly suited my need to find the best matching images in two file sets. The file sets are related to each other: they origin the same celluloids, but were created with different quality of scanning equipment. In addition, cropping and tilting may have taken place, and in different ways. I modified the example code to create a file with information on the best fitting high-quality-version of the low-Q image, as well as the three top score values. Here is the code that runs perfectly in Python, version 3.10. I am using PyScripter: great! You can easily test it with your own files, though it may require a series of Python modules to be installed before it runs. from sentence_transformers import SentenceTransformer, util from PIL import Image model = SentenceTransformer("clip-ViT-B-32") f = open("E:/Fotos/testmap/ListMatchingFotos.txt", "a") lijst = ["E:/Fotos/File_nr1.JPG","E:/Fotos/File_nr2.JPG"] # this is the list of low quality images. image_names = ["M:/Fotos/negatieven 001.jpg","M:/Fotos/negatieven 002.jpg","M:/Fotos/negatieven 003.jpg","M:/Fotos/negatieven 004.jpg","M:/Fotos/negatieven 005.jpg","M:/Fotos/negatieven 006.jpg","M:/Fotos/negatieven 007.jpg","M:/Fotos/negatieven 008.jpg"] image_names += lijst encoded_image = model.encode([Image.open(filepath) for filepath in image_names], batch_size=128, convert_to_tensor=True, show_progress_bar=False) processed_images = util.paraphrase_mining_embeddings(encoded_image) threshold = 0.99 near_duplicates = [image for image in processed_images if image[0] < threshold] L = len(near_duplicates) for j in range(len(lijst)): # narrow the list of pairs to consider only the files in the "Lijst" searchresults = [] for i in range(0,L): score, image_id1, image_id2 = near_duplicates[i] idf = image_names.index(lijst[j]) if (( (image_names[image_id1] == image_names[idf] ) and (image_id2 != idf) ) and (not (image_names[image_id2] in lijst))) or (( (image_names[image_id2] == image_names[idf] ) and (image_id1 != idf) ) and (not (image_names[image_id1] in lijst))): searchresults.append( near_duplicates[i] ) ls = len(searchresults) score1 = 0 score2 = 0 score, image_id1, image_id2 = searchresults[0] if ls > 1: score1, image_id11, image_id21 = searchresults[1] if ls > 2: score2, image_id12, image_id22 = searchresults[2] if image_id1 != idf: image_id2 = image_id1 if score < 85/100: f.write( image_names[idf] + " " + image_names[image_id2] + " Score1: {:.3f}%".format(score * 100) + " Score2: {:.3f}%".format(score1 * 100) + " Score3: {:.3f}%".format(score2 * 100) + str(" NO MATCH OR VERY POOR \n")) else: f.write( image_names[idf] + " " + image_names[image_id2] + " Score1: {:.3f}%".format(score * 100) + " Score2: {:.3f}%".format(score1 * 100) + " Score3: {:.3f}%\n".format(score2 * 100)) f.close() However, the very same code doesn't run in Python4Delphi, although it uses the same PythonEngine.dll and path and libraries. I got the error message "Project .... raised exception class EPyAttributeError with message 'AttributeError: 'NoneType' object has no attribute 'flush'". The error is generated in the very first line "from sentence_transformers import...", on both modules, either combined or in separate lines. Here is my delphi version of the code above. Function TPyForm.Picture_Matching_using_Python(Foto_bestanden : String; VAR Zoeklijst :TArray<string>; TekstBestand :String; TargetScore : integer) : Boolean; VAR Mem :TStringList; Lijst, BeterLijst: String; Fotos : Tarray<String>; begin If Foto_bestanden = '' then exit; Fotos := Foto_bestanden.Split([',']); Lijst := '['; BeterLijst := '['; for Var Bestand : String in Fotos DO Lijst := Lijst + '"' + B2F(Bestand) + '"' + ','; Lijst := copy(Lijst,1,length(Lijst)-1)+ ']'; for Var Bestand : String in Zoeklijst DO BeterLijst := BeterLijst + '"' + B2F(Bestand) + '"' + ','; BeterLijst := copy(BeterLijst,1,length(BeterLijst)-1)+']'; TRY Mem := TStringList.Create; With Mem DO begin Add('import os'); Add('from PIL import Image'); Add(' from sentence_transformers import SentenceTransformer, util'); Add('model = SentenceTransformer("clip-ViT-B-32") '); Add('f = open("' + B2F(TekstBestand) + '", "a")'); Add('lijst = '+ Lijst ); Add('image_names = '+ BeterLijst ); Add('image_names += lijst'); Add('encoded_image = model.encode([Image.open(filepath) for filepath in image_names], batch_size=128, convert_to_tensor=True, show_progress_bar=False)'); Add('processed_images = util.paraphrase_mining_embeddings(encoded_image)'); Add('threshold = 99/100'); Add('near_duplicates = [image for image in processed_images if image[0] < threshold] '); Add('l = len(near_duplicates) '); Add('for j in range(len(lijst)): '); Add(' searchresults = [] '); Add(' for i in range(0,l): '); Add(' score, image_id1, image_id2 = near_duplicates[i] '); Add(' idf = image_names.index(lijst[j]) '); Add(' if (( (image_names[image_id1] == image_names[idf] ) and (image_id2 != idf) ) and (not (image_names[image_id2] in lijst))) or ' + ' (( (image_names[image_id2] == image_names[idf] ) and (image_id1 != idf) ) and (not (image_names[image_id1] in lijst))): '); Add(' searchresults.append( near_duplicates[i] ) '); Add(' ls = len(searchresults) '); Add(' score1 = 0' ); Add(' score2 = 0' ); Add(' score, image_id1, image_id2 = searchresults[0]'); Add(' if ls > 1: score1, image_id11, image_id21 = searchresults[1] '); Add(' if ls > 2: score2, image_id12, image_id22 = searchresults[2] '); Add(' if image_id1 != idf: image_id2 = image_id1'); Add(' if score < ' + TargetScore.tostring + '/100: '); Add(' f.write( image_names[idf] + " " + image_names[image_id2] + " Score1: {:.3f}%".format(score * 100) + " Score2: {:.3f}%".format(score1 * 100) + " Score3: {:.3f}%".format(score2 * 100) + str(" GEEN OF TWIJFELACHTIGE MATCH \n"))'); Add(' else:'); Add(' f.write( image_names[idf] + " " + image_names[image_id2] + " Score1: {:.3f}%".format(score * 100) + " Score2: {:.3f}%".format(score1 * 100) + " Score3: {:.3f}%\n".format(score2 * 100))' ); Add('f.close() '); end; TRY Result := True; PythonEngine1.ExecString( ansiString( Mem.text ) ); Except Result := False; END; FINALLY Mem.Free; END; end; I have no idea how to proceed, and do hope that anyone does. I would very much appreciate any help. Jan
  3. program Project2; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Math; begin var a,b:double; a:=1.015; b:=2.275; writeln(round(a*Power(10,2))); writeln(round(b*Power(10,2))); readln; end. Please run as 32 and 64bit I split this off to its own topic, so that future readers will find this tightly packaged. Please consider creating a new thread for any question/issue/remark that is not exactly the same as the opening post of a thread - Sherlock
  4. IMG SPA

    Delphi To IOS Deploying error

    Hello, I'm trying to deploying a Delphi FMX application to iPhone IOS. I have no problems on connecting with the MAC but I have an internal API error on executing (please see attached file) Delphi version: 11.2 Patch 1 IOS version: 16.6 X-code version: 14.3.1 Can anyone help me? Thanks
  5. I have an e-scooter that I use for riding around towns and trails. There is an app to download. However, that app does not connect to my scooter and the developer is slow to fix/resolve/respond and still does not connect. So, I would like to look into writing my own app for my phone (android) to do the following: 1. track start and end times 3. track my routes - where i've been or stopped at 4. show the miles I am traveling during my ride in real-time 5. show the total miles of my ride 6. possibly show speed (via calculation) and in real-time 7. eventually, to show a map of my route in real-time, and show all my stops Is this possible with Delphi 11.2 and free components/services/API's ?
  6. I'm trying to follow Dave Millington's code rage example from 2016 on how to use a Delphi abstract class to make an abstract class for use in a C++ Builder bpl library where you need to link to a lib file that is only available in C. https://learndelphi.org/this-is-how-to-use-c-builder-to-extend-the-reach-of-delphi/ https://github.com/Embarcadero/CodeRage2016 I made a function called about in my concrete class called TBridge::About derived for a pure abstract delphi class which I can call sucessfully. However when I do so Application->MessageBox falls over as it doesn't seem able to create a font resource or lacks resources. I am assuming in am not linking some sort of necessary resource file into my C++ BPL ? The question is I don't know which files I should be linking into the BPL to get it to display standard VCL dialogs. MessageDlg doesn't work either. //--------------------------------------------------------------------------- #pragma hdrstop #include "SolidBridge.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #include <windows.h> #include <vcl.h> #include <Vcl.Controls.hpp> #include <Vcl.stdCtrls.hpp> #include <Vcl.Forms.hpp> #include <Dialogs.hpp> #include <Vcl.Dialogs.hpp> void __fastcall TBridge::About() { //Application->MessageBox('Hello world!','About',MB_OK); UnicodeString txt = "Hello world"; Application->MessageBox(L"Hello world",L"About", MB_OKCANCEL); //MessageDlg(txt,mtInformation,TMsgDlgButtons() << mbOK,0); } TAbstractBridge* __stdcall SolidBridgeFactory() { return (TAbstractBridge*)new TBridge(); } ResData is passed in a zero so the first line ResHash := VCL.Graphics.GetHashCode(ResData, ResDataSize); throws an exception in VCL.Graphics {$IF NOT DEFINED(CLR)} function TResourceManager.AllocResource(const ResData): PResource; var ResHash: Word; LOwner: TThreadID; begin ResHash := Vcl.Graphics.GetHashCode(ResData, ResDataSize); Lock; try LOwner := TThread.CurrentThread.ThreadID; Result := ResList; while (Result <> nil) and ((Result^.Owner <> LOwner) or (Result^.HashCode <> ResHash) or not CompareMem(@Result^.Data, @ResData, ResDataSize)) do Result := Result^.Next; if Result = nil then begin GetMem(Result, ResDataSize + ResInfoSize); with Result^ do begin Next := ResList; RefCount := 0; Handle := TResData(ResData).Handle; HashCode := ResHash; Owner := LOwner; Move(ResData, Data, ResDataSize); end; ResList := Result; end; Inc(Result^.RefCount); finally Unlock; end; end; {$ENDIF}
  7. robertjohns

    Wow64EnableWow64FsRedirection

    Hello I am trying to check file existence in both directories c:\windows\system32 and c:\windows\syswow64 I tried to use Wow64EnableWow64FsRedirection true and false method, when I do not use Wow64EnableWow64FsRedirection method I get c:\windows\syswow64 but when I use Wow64EnableWow64FsRedirection(False); I get c:\windows\system32 but issue is when I use Wow64EnableWow64FsRedirection(True); I do not get c:\windows\syswow64 I am actually trying On Disable, c:\windows\system32 On Enable, c:\windows\syswow64
  8. Hi all, I'm looking to find a decent, easy-to-use Profiler to help identify performance bottlenecks and memory leaks. I'm a small-project user so not looking to pay too much - free and open source options are welcome as long as they're straightforward to use - no command line stuff, please. It's 2023 and I'm using RAD Studio 10.4.2 - I believe SmartBear used to provide a standard version of AQTime with an earlier version of RAD, shame they stopped doing this really because now it seems we have to pay big bucks for this particular profiling system. Recommendations and suggestions welcome, thank you!
  9. robertjohns

    Cecking Application Execution

    Is there any possibility to check if the exe is executed by clicking on its own icon or by external exe Suppose Exe-1 and Exe-2 Need to check Exe-1 is whether executed by clicking on its own icon or executed by external Exe-2
  10. Hi, Here is a problem. I would like to run an application with normal user privileges from elevated process. My installer (elevated process) is written in Delphi. It launches some programs at the end of installation. Now, as Installer is elevated, lauched process is also elevated - we don't want this! The goal is to launch non-elevated process from elevated installer process. So: - Launch any application with normal user privileges - Launch default web browser with given webpage - Send email to given person (with protocol Sendto:) As far as I know it can be done using Windows Explorer process. I couldn't find any Delphi code for that in Internet 😞 I only found C- based. Here is one that suppose to work: https://www.appsloveworld.com/coding/delphi/48/createprocess-with-lower-privileges-than-the-caller Could you please try to convert it into Delphi? I tried, but without success (see below example). There are some problems with pointers (I tried to do pointers typecasting - it compiled, but with access violation)... For example: FindDesktopFolderView(IID_IShellView, spsv); --> FindDesktopFolderView(IID_IShellView, Pointer(spsv)); I am sure, this is not a way I should do. Here is my code in simple project. Source: https://www.dropbox.com/s/6ndno59brgbn6l0/ExecAsUser.zip?dl=1 Thanks in advance, -Pawel
  11. I have created library for Delphi-Console-Applications Supports Windows 11 (and earlier from XE5?) Replaces CRT Unit - crt.pas Can be used to write modern and appealing console applications. Should allow older (legacy) source code (Borland Pascal 7.0) to run under Windows. Unicode-Support (including e.g. chinese characters) many more features - see GitHub https://github.com/playcom-de/Console I hope this is helpful for someone. Question, suggestions and error reports are welcome.
  12. i have this code here: fTask: ITask; fTask := TTask.Create( procedure begin while not True do Application.ProcessMessages; TThread.Synchronize(TThread.Current, procedure begin // update ui end); end); fTask.ExecuteWork; // this will stop here.. until [fTask] finish work !! In android didn't wait untill Task Complete !!
  13. Hello, I'm trying to create a combobox that I can style to look like this. I'd **LIKE** to do it solely in the WYSIWYG style designer. Can anyone point me to a tutorial on how even to change the font size in the Style designer? I'm admittedly such a noob in this, but I'm at a total loss. Thanks. - Mike
  14. robertjohns

    File Search

    I am using Delphi 10.2 Is it possible to search Directories and Sub-Directories by File Name instead File Mask like mytext.txt instead of *.txt So far I tried the following function but it does not work by filename it works with file extension another issue with this function is that it does not list the complete searched files from Windows\system32\drivers\ procedure FindFilePattern(root:String;pattern:String); var SR:TSearchRec; begin root:=IncludeTrailingPathDelimiter(root); if FindFirst(root+'*',faAnyFile,SR) = 0 then begin repeat Application.ProcessMessages; if ((SR.Attr and faDirectory) = SR.Attr ) and (pos('.',SR.Name)=0) then FindFilePattern(root+SR.Name,pattern) else begin if pos(pattern,SR.Name)>0 then Form1.ListBox1.Items.Add(Root+SR.Name); end; until FindNext(SR)<>0; end; end; procedure TForm1.Button1Click(Sender: TObject); begin FindFilePattern('C:\','.sys'); end;
  15. I have a unit which tries to use the TListView in Virtual mode, by setting OwnerData to true. Theroretically all this should simply work, as long as I monitor the OnData, OnSelectItem, OnDataStateChange and possibly OnChange. But what happens, it that all 'OnSelect's are reported by Windows, but NOT all 'unSelect's. As a result, my VirtualItemList end up with more and more Selected Items, while in reality, there is (for example) only 1 Selected Item in the ListView. Below is an (Log) example of what happens: = I click on item 0: OnSelectItem: Item not assigned! OnChange: Index=0 Virtual Count=3001 Item=Caption 0 Selected=TRUE OnSelectItem: Item=Caption 0 Item.Selected=TRUE Selected=TRUE = I now shift-click on Item3, to multi-select all 4 Items: VirtualItemList.OnSelectItem: Item not assigned! *** OnDataStateChange: Start=0 End=3 *** OnDataStateChange: 0 Item: Caption 0 Selected=TRUE *** OnDataStateChange: 1 Item: Caption 1 Selected=TRUE *** OnDataStateChange: Changing VirtualItem Caption 1 to TRUE *** OnDataStateChange: 2 Item: Caption 2 Selected=TRUE *** OnDataStateChange: Changing VirtualItem Caption 2 to TRUE *** OnDataStateChange: 3 Item: Caption 3 Selected=TRUE *** OnDataStateChange: Changing VirtualItem Caption 3 to TRUE OnChange: Index=0 Virtual Count=3001 Item=Caption 0 Selected=TRUE OnChange: Index=3 Virtual Count=3001 Item=Caption 3 Selected=TRUE MouseUp: Base Selcount=4 Virtual=4 REAL=4 NOTE: - OnSelectItem is NOT called during 'Shift-Click' for the Selected items. - I now must use OnDataStateChange to Select these. - OnChange is ONLY called for Index 0 and 3. Not for the ones in between. = I now click on Item 4. (This should UN-select all other Items. It does do so on the screen...) OnSelectItem: Item not assigned! OnChange: Index=3 Virtual Count=3001 Item=Caption 3 Selected=FALSE *** OnChange: Caption 3 has changed to: FALSE OnChange: Index=4 Virtual Count=3001 Item=Caption 4 Selected=TRUE *** OnChange: Caption 4 has changed to: TRUE OnSelectItem: Item=Caption 4 Item.Selected=TRUE Selected=TRUE MouseUp: Base Selcount=1 Virtual=1 REAL=4 NOTE: - The OnChange only reported UNSelect for Item 3, and the Select for Item 4, but there is no event anywhere for Item 0, 1 and 3. - I now have FOUR Selected items in my Virtual List (The SelCount is hard overwritten from the ListView Selcount) - OnDataStateChange is NEVER called to report all the UN-Selects. The entire Test program source code can be downloaded here (200k): https://sartrack.nz/temp/VirtualListViewTest.zip I really wonder if it possible at all to do this, as this seems to be a Windows issue. Using Windows 10, Delphi 11.
  16. Qasim Shahzad

    Why Should a C-Sharper Learn Delphi?

    I plan to create some introductory videos for my DelphiTube channel on this topic: Delphi for C-Sharpers The question is, why should a C-Sharper (C# user) learn Delphi? I am definitely biased toward Delphi, but is it really beneficial for a C-Sharp user? My thoughts are: Learning another language is a good option. Delphi can create standalone executable that do not need third-party frameworks. You can build cross-platform native applications with Delphi. It would be an easy move if you joined through the C++ Builder path. Delphi is highly productive. What's your point of view? Can you add some reasons? Please guide. Thank you so much for your attention and participation.
  17. robertjohns

    Find String in TstringList

    I am trying to find find Strings in TstringList I used almost all method but nothing working In StringList I have some some.pds other other.cff -- I am trying to find some.pds ad other.cff .. Result is True but If in Stringlist some other -- and still I am trying to find some.pds ad other.cff .. but still Result is True whereas it should return false How can I find Specific string in Tstringlist
  18. robertjohns

    Form Creation

    I am creating a Form1 and freeing it after some time Now I am trying to check if Form1 is created then create Form2 If Assigned(Form1) then Application.CreateForm(TForm2, Form2); But It does not seems to work any suggestion
  19. I need to run a small program in the Windows Preinstallation Environment, my program works fine on v7 & v10, but crashes on v8.1. Windows 8.1 ISO: https://www.microsoft.com/en-us/software-download/windows8 On the Windows Installer window, I press Shift+F10 to open CMD, then I run the program from there. Here is the example code, I'm using Delphi 11.3 CE: program Project3; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; begin WriteLn('Test'); ReadLn; end. Here is the result if SysUtils is included: Here is the result if SysUtils is not included, so I suspect the problem comes from the SysUtils unit. I'm new to Delphi recently and don't have the ability to debug in this case. Please help, thanks for everything.
  20. Dear all, I have install the Delphi 11.3 CE and try to compile the project to iOS64 target and received this exception [Fatal Error] Module not found: dcciosarm64280.dll I have tried to reinstall the Delphi on two different PCs but nothing changed. Any idea where the problem is ? Thank you Regards Jan
  21. EDIT: Apologies for the rant-like nature of this post, but... I'm getting frustrated with Delphi programming. Rather than toss my laptop out the window, I'd rather express my frustration here on the Forums and hopefully it comes to something a bit more productive than a broken laptop and a feeling of regret. ----- Why can I sometimes access properties, functions, variables etc from other units, and sometimes not? "Private" and "public" doesn't seem to make any difference, either. Sometimes I'll start to type the name of a class, followed by "." and a list of all the available items comes up. I assure you, sometimes even when I make something "public", it still won't appear in that list. Why??? Also, the practice of creating "instances" of classes within procedures is ridiclously cumbersome and unintuitive. If I've created a property/variable/field/whatever in Class1.pas, it should be accessible from Class2.pas without me having to create a "version" of Class1 first. If it's declared in uses, that should be that! Forgive me for the rant, but aren't we as programmers supposed to be in charge of the program, not the other way around?!
  22. VishalTanwar

    Delphi Debugging Help

    Hi All, I am new to learn Delphi technology. I am using Delphi 7 application. Can anyone help me regarding learning part. from where I need to start and what things i need to see. I got the basic details from the internet but still I am struggling for debugging part. If anyone can help, please let me know. Thank You
  23. Dumpfbacke

    Unigui and TShape

    Hello everyone here. I have a VCL program which I would now like to convert to UniGui. It's an easy part here, at least I thought so in the beginning. There is a TImage in which I want to draw a rectangle, which is transparent as a TShape. I do my program like this Shape is a TShape; OnMouseDown Shape.Left := X; Shape.Top := Y; Shape.Width := 0; Shape.Height := 0; OnMouseMove Shape.Width := X - Shape.Left; Shape.Height := Y - Shape.Top; OnMouseUP Shape.Width := X - Shape.Left; Shape.Height := Y - Shape.Top; repaint; At the end I would also like to have the coordinates of the shape. There is no onMouseMove in TUniImage, but that wouldn't be so bad because the rectangle is mainly drawn at the end. Can someone help me here? Is there an alternative to TShape for UniGui? Thanks in advance for your help. Tanja
  24. If you want to specify "i" as being any value between 0 - 7, you can use for i := 0 to 7 do And, as I understand it, this will run code as long as "i" matches any value between 0 and 7. But, what if you only want to run the code when "i" matches every value between 0 and 7 at the same time? So, for example, rather than typing: if (X, Y - 0) and (X, Y - 1) and (X, Y - 2) and (X, Y - 3) etc... Is there a way to express it as (X, Y - i) where i can be any value between 0 and 7, but every value must be accounted for simultaneously?
  25. The app I'm working on has different "screens", which are each essentially large bitmaps. When closing a screen to go to the next one, the following code provides a fade-to-black transition effect: procedure TGameBaseScreen.FadeOut; var Steps: Cardinal; i: Integer; P: PColor32; StartTickCount: Cardinal; IterationDiff: Integer; RGBDiff: Integer; const TOTAL_STEPS = 32; STEP_DELAY = 12; begin Steps := 0; StartTickCount := GetTickCount; while Steps < TOTAL_STEPS do begin IterationDiff := ((GetTickCount - StartTickCount) div STEP_DELAY) - Steps; if IterationDiff = 0 then Continue; RGBDiff := IterationDiff * 8; with ScreenImg.Bitmap do begin P := PixelPtr[0, 0]; for i := 0 to Width * Height - 1 do begin with TColor32Entry(P^) do begin if R > RGBDiff then Dec(R, RGBDiff) else R := 0; if G > RGBDiff then Dec(G, RGBDiff) else G := 0; if B > RGBDiff then Dec(B, RGBDiff) else B := 0; end; Inc(P); end; end; Inc(Steps, IterationDiff); ScreenImg.Bitmap.Changed; Changed; Update; end; end; Is there any way this same code can be modified to create a new FadeIn; procedure which allows the screen images to fade-in-from-black? I'm guessing I need to first specify that RGB := 0, 0, 0 and then increase the RGB values until they reach the actual bitmap values. Do I first need to "get" those values somehow? Or, is there a better way to achieve the Fade In/Out procedures? (note that we're dealing with combined bitmaps here, rather than single images)
×