Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/04/20 in all areas

  1. GExperts supports even more laziness I got into programming because I am lazy, I’d rather have the computer do the boring work than doing it myself. So it’s no wonder that I always liked Delphi and GExperts because both support my laziness. Today I added yet another feature to save me a key stroke or mouse click: The “Close Exception Notification” expert. You probably have encountered those libraries that always raise the same exception class on errors, or even worse, raise the generic Exception class instead of bothering to declare their own. And if I should guess, you have probably been guilty of doing that yourself (as I definitely have). Why is that a problem, you ask? Because you can’t easily ignore these exceptions during debugging. You always get this “Debugger Exception Notification” dialog, have to read it and decide whether you want to break and look at the code or ignore the exception. Read on in the blog post.
  2. Mike Torrettinni

    Problem with ExitCode

    In short: Seems like ExitCode is not always reliable retrieved with %ERRORLEVEL% if Project is not a console project. Long version: I'm testing simple example of how ExitCode works. The problem is that I can't reliable retrieve it with %ERRORLEVEL%, when not running in batch file. When executing example project in batch file, it works OK, always shows correct ExitCode as %ERRORLEVEL%. This is batch file - that always works: project1.exe echo %ERRORLEVEL% echo always show correct ExitCode as set in project1.exe. BUT: When I try to execute the same project1.exe from cmd line, without batch file, it doesn't reliable returns ExitCode with echo %ERRORLEVEL%. This is how I run it without batch file: This is simple VLC Forms project: program Project1; uses Vcl.Forms, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} begin Application.Initialize; ExitCode := 2; // Application.MainFormOnTaskbar := True; // Application.CreateForm(TForm1, Form1); // Application.Run; end. Then, I tried to do the same with Console project and in this case %ERRORLEVEL% always works correct - show correct ExitCode, with and without batch file. So, am I missing something really obvious? Is non-console project the problem here?
  3. Mahdi Safsafi

    Problem with ExitCode

    When calling a console application from CMD, current CMD becomes a window for that application. And CMD will wait for that application to terminate in order to execute the next instruction. With that being said, CMD can have the correct ERRORLEVEL. But when calling a non-console application, CMD runs the application and returns immediately without waiting the application to be terminated. So it can't have a correct ERRORLEVEL. using START /WAIT app.exe will create a new CMD2(console) that runs app.exe inside CMD2. and current CMD will wait CMD2 to terminate. So it would have the correct ERRORLEVEL.
  4. Anders Melander

    Problem with ExitCode

    You are just repeating what you wrote in your OP. It's really very simple. Just abandon your assumption that commands entered on the command prompt are treated the same way as commands in a batch file; They are not. The behavior you are observing is as expected. For console applications both cmd and bat will start the process, wait for its termination and set errorlevel to the process exit code. For GUI applications bat will do the same as for console applications, but cmd will start the process without waiting for it to terminate. The value of errorlevel is irrelevant. All this has nothing to do with Delphi BTW.
  5. Lars Fosdal

    Where to put SQLite/MDB database in UWP app

    Look at the TPath type in System.IOUtils.- it is cross platform and has a number of methods for getting "special" folders. http://docwiki.embarcadero.com/Libraries/Sydney/en/System.IOUtils.TPath_Methods
  6. mikerabat

    LINEST function

    Hi! You could use the regression functions from here: https://github.com/mikerabat/mrmath and the regression example from here: http://www.mrsoft.org/home/downloads.html
  7. Geoffrey Smith

    Sending Email via GMail Using OAuth 2.0 via Indy

    I have updated the demo. The demo now includes saving and loading refresh tokens, as well as checking for expired access_tokens and refreshing them with the refresh_token. Have a look at https://github.com/geoffsmith82/GmailAuthSMTP/ Geoffrey
  8. Geoffrey Smith

    Sending Email via GMail Using OAuth 2.0 via Indy

    I've updated my project so it now not only sends messages via gmail... but it can send hotmail.com/live.com/outlook.com emails. GmailAuthSMTP supports the XOAUTH2 and OAUTHBEARER authentication types and so could probably support other mail providers if they use those standards as well. https://github.com/geoffsmith82/GmailAuthSMTP/
×