[Lazarus] Hello World program generates a File Not Open runtime error

Sven Barth pascaldragon at googlemail.com
Sun Jan 29 16:21:13 CET 2012


Maybe a "simple console application" project could be added to Lazarus 
or "{$apptype console}" could be added by default to "custom program" 
projects.

It will not be changed however, that console I/O is possible without 
{$apptype console}, because it was only rather recently changed to be 
this way (because this is how users expect Windows applications to behave).

Regards,
Sven

On 29.01.2012 16:13, Antônio wrote:
> Maybe something could be done to make things easier for Windows users?
>
> Antônio
>
> 2012/1/29 Sven Barth<pascaldragon at googlemail.com>:
>> On 29.01.2012 15:43, Antônio wrote:
>>>
>>> Only on Windows?
>>>
>>> Antônio
>>>
>>> 2012/1/29 Sven Barth<pascaldragon at googlemail.com>:
>>>>
>>>> On 29.01.2012 15:31, Antônio wrote:
>>>>>
>>>>>
>>>>> program project1;
>>>>>
>>>>> {$mode objfpc}{$H+}
>>>>>
>>>>> uses
>>>>>    {$IFDEF UNIX}{$IFDEF UseCThreads}
>>>>>    cthreads,
>>>>>    {$ENDIF}{$ENDIF}
>>>>>    Classes
>>>>>    { you can add units after this };
>>>>>
>>>>> begin
>>>>>    WriteLn('Hello World');
>>>>>    ReadLn();
>>>>> end.
>>>>>
>>>>> Any problem? Am I missing something?
>>>>
>>>>
>>>>
>>>> Are you on Windows? Then you must add "{$apptype console}".
>>
>>
>> Windows and perhaps OS/2 are the only systems that differentiate between GUI
>> and console applications.




More information about the Lazarus mailing list