Every once in a while I'm editing some long pair of if-then-else statements (or worse, nested if-then-else statements) , like, say, this:
if A < B then
begin
DoSomething;
DoSomethingElse;
{...and more statements going on and on and on...}
FinallyWrapUpThisBit;
end
else
begin
DoThis;
DoThat;
{......
How do I check if another application is busy?
I have a program that sends text to a console. The text that I will send contains #13 char (i.e. ls#13cd documents#13dir). In other words I want to send many commands at one time and the console will process it one by one. I am sending it character by character. But sometimes it only execut...
I have a working application that I have revisited recently.
I store a file in a text field in a MSSQL database. I read it into an ADOTable and as a TBlobfield call Savetofile to write it to a file on disk. This has always worked. However now it is simply saving a 8 byte file rather than the correct file.
I have a vague memory of ...
I am trying to understand how to implement a Code Coverage tool using the Win32 Debugging API.
My thinking has been to utilize the Win32 Debugging API to launch a process in debug mode - and track what CPU instructions has been executed. After having tracked all CPU instructions I would then use the map file to map it to what source cod...
How can I send email through gmail smtp account using ICS component?
...
I have a main app and a type library contains 2 COM objects, one is IFile, one is IFiles. IFiles creates IFile, and stores them in a TLIST, and has standard methods like Add, Remove etc. Both IFile and IFiles are TAutoObject.
"Add" method in IFiles is working fine, it simply creates IFile object [Code 1], and adds it to TList. Problem i...
hi, is there a send api to access a menu command in another application? For example,I am trying to access the View menu of a notepad. How am I going to do this? I already got the menu using GetSystemMenu but I can't access it. I think this has an API already but I don't know.
...
Hi,
I have created a custom TAction type which has 2 additional properties which are of type string, and enumeration.
The string value is showing in the object inspector fine, however, the enumeration type is not appearing at all. How can I get a custom enumeration type to display as a drop down property value in the object inspector?
...
We are a team that use Gnostice and RaveReports to view, print, mail and generate PDFs of reports using D2007. D2009 is in the roadmap but as Gnostice don't support D2009 we have to wait. In the past the reports was done in code and then viewed, printed etc.
Now we have started to evaluate the Ravereports designer and make reports with t...
I am having utf-8 encoded file containing arabic text and I have to search it.
My problem are diacritics, how to search skipping them?
Like if you load that text in Internet Explorer (converting text in HTML ofcourse ), IE is skipping those diacritics?
Any help?
Edit1: Search is simply performed by following code:
var m1 : TMemo; /...
It's easy enough to find all your external dependencies. Just run the program and open up the Modules info window. But how can I find all my internal dependencies? I know the program keeps a list of all the units, because I've traced my way through the initialization code a time or two. But is there any easy way to access this list f...
We had the following code previous to Delphi 2009:
function MemoryStreamToString(M: TMemoryStream): String;
var
NewCapacity: Longint;
begin
if (M.Size = 0) or (M.Memory = nil) then
Result:= ''
else
begin
if TMemoryStreamProtected(M).Capacity = M.Size then
begin
NewCapacity:= M.Size+1;
TMemoryStreamProtec...
I'm moving frequently between D7 and D2009 with library code that works with both. For ease of going both ways, I'm routinely deleting all the D2009 additional files that get created, eg *.dproj etc such that on entry to D2009 I'm only ever taking D7 files. This is nice because D2009 automatically makes a *.dproj, *.dgroup etc and apart ...
We have a Delphi 7 application that runs as an ISAPI extension in IIS6. The code use ADO to connect to a MS SQL 2000 database and performs many reads on the database (no writes). If I watch the audit login and logout events in SQL profiler I can see that numerous requests to the app result in only 1 audit login event. However, if I ru...
I am using TApplicationEvents OnShortCut event to get application keyboard short cuts in a Delphi program.
Using the following code:
procedure TForm1.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean) ;
begin
if (Msg.CharCode = VK_F9) then
begin
ShowMessage('F9 pressed!') ;
Handled := True;
end;
end;
...
I am debugging a windows batch command file. It is failing when extended (> 0x7f) characters are used in the paths or file names. The problem seems to be related to passing parameters to a command file that is CALLed from another.
For an example, this command works as expected:
xcopy "Pezuñero\1 - 001.wav" \temp
This does not:
call ...
I'm looking for a Delphi component / library to open and read from an mdb (MS Access) database. I will not be writing to the db or displaying the data; just need to read the db using whatever sql Access supports.
This is for a personal side-project (programming is not my paying job), so I need a free or a very inexpensive solution that...
I'm using delphi6, and our company don't want to upgrade it,
and I found Tidftp lack the MLSD command,
So what is the free ftp component you are using now?
ps : I searched for one on Google, but I don't know which is stable and standard.
...
how do i debug something like this? i need the debugger to stop and show me where the problem is. don't just show it in the event log & then hang.
first chance exception: system error 8: not enough storage space to perform the command
i'm using delphi 2009. the problem doesn't happen regulary. i'm not eager to pepper my program w...
Delphi only supports SOAP 1.1, and includes a WSDL importer. Is there a 'litmus test' to see if a web service uses SOAP 1.1 or 1.2, based on the information in the WSDL?
...