* * *

Author Topic: in the IDE not getting an output  (Read 1238 times)

phantom21

  • New member
  • *
  • Posts: 7
in the IDE not getting an output
« on: February 07, 2018, 11:23:56 pm »
I've tried running a program.  Works in the command line IDE, but don't get an output from the Lazarus GUI.  Further, there may be n issue with configuration.  Running Linux, so where are the "sources" for configuration?  Thanks.

howardpc

  • Hero Member
  • *****
  • Posts: 2561
Re: in the IDE not getting an output
« Reply #1 on: February 07, 2018, 11:51:25 pm »
Is your app a console program?
If so, do you have the Console window open (View->Debug Windows->Terminal Output)?

phantom21

  • New member
  • *
  • Posts: 7
Re: in the IDE not getting an output
« Reply #2 on: February 08, 2018, 01:05:35 am »
No.  the console program is doing properly.  The problem is with the GUI (Lazarus) app.

howardpc

  • Hero Member
  • *****
  • Posts: 2561
Re: in the IDE not getting an output
« Reply #3 on: February 08, 2018, 12:00:01 pm »
If you share the sources to the misbehaving program, the cause will probably be obvious to someone on this forum.

phantom21

  • New member
  • *
  • Posts: 7
Re: in the IDE not getting an output
« Reply #4 on: February 09, 2018, 05:29:55 am »
what do you mean sources?

Thaddy

  • Hero Member
  • *****
  • Posts: 5353
Re: in the IDE not getting an output
« Reply #5 on: February 09, 2018, 08:27:07 am »
source code
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

phantom21

  • New member
  • *
  • Posts: 7
Re: in the IDE not getting an output
« Reply #6 on: February 09, 2018, 04:26:28 pm »
I've written some simple source code for testing and retraining myself.  It works completely nad properly in the CLI IDE, but, while it is EXACTLY the same in the GUI (Lazarus) IDE and compiles, it does not show the output.  Here's the code.
PROGRAM Test_While ;

VAR
  x, y : INTEGER;

  PROCEDURE Loop(inner, outer: INTEGER) ;

  VAR
  inner1 : INTEGER ;

  BEGIN

    WHILE outer > 0 DO
    BEGIN
      inner1 := inner ;

      WHILE inner1 > 0 DO
      BEGIN
        WRITE('outer = ', outer);
        WRITELN('   inner = ', inner1);
        inner1 := inner1 -1 ;
      END ;
      outer := outer - 1 ;

    END ;
  END ;

BEGIN

  x := 4;
  y := 7;

  Loop(x,y);
  READLN ;

END.             

rvk

  • Hero Member
  • *****
  • Posts: 3118
Re: in the IDE not getting an output
« Reply #7 on: February 09, 2018, 04:49:45 pm »
It works completely nad properly in the CLI IDE, but, while it is EXACTLY the same in the GUI (Lazarus) IDE and compiles, it does not show the output.
How did you "create" this GUI program?

If you did it in Lazarus and just copied the code you should have gotten an error.

You can't just use writeln() in a GUI program.

Just begin with creating a propper GUI-application with Project > New Project and choose Application.
Go from there. (But note that GUI-programming is completely different from console-programming)

taazz

  • Hero Member
  • *****
  • Posts: 4749
Re: in the IDE not getting an output
« Reply #8 on: February 09, 2018, 04:51:38 pm »
start the lazarus IDE go to the menu project\New Project on the dialog that appears select "simple program" copy the code you posted here and paste it in the unit created then run. Does it create any output?
It works completely nad properly in the CLI IDE, but, while it is EXACTLY the same in the GUI (Lazarus) IDE and compiles, it does not show the output.
How did you "create" this GUI program?

If you did it in Lazarus and just copied the code you should have gotten an error.

You can't just use writeln() in a GUI program.
I thought that in linux there is no differenc between gui and console all applications where console applications they just did not open the console window by default.
« Last Edit: February 09, 2018, 04:55:03 pm by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

rvk

  • Hero Member
  • *****
  • Posts: 3118
Re: in the IDE not getting an output
« Reply #9 on: February 09, 2018, 05:25:10 pm »
I thought that in linux there is no differenc between gui and console all applications where console applications they just did not open the console window by default.
Ha, yes, you're correct. I see there is no error given under Linux.

I also see now what phantom21 means by not having a console window in Lazarus IDE when running a simple console application. It doesn't appear automatically like in Windows.

@phantom21, you can choose View > Debug Windows > Terminal Output or press Ctrl+Alt+O to get the window you want with your output/input.

The other option is Run > Run parameters and check the "Use launching application" checkbox.
(it's in the wiki: http://wiki.freepascal.org/Console_Mode_Pascal)
« Last Edit: February 09, 2018, 05:29:58 pm by rvk »

phantom21

  • New member
  • *
  • Posts: 7
Re: in the IDE not getting an output
« Reply #10 on: February 10, 2018, 08:52:00 pm »
thanks, I tried all of those options and I get a message window with these messages:

Panic: internal error: Access violationCompile Project, Target: Test_For: Access violation
  $0000000000F1BC84
  $0000000000F1C727
  $0000000000F1C6A6
  $000000000094C502
  $000000000095164C
, Errors: 6
Panic: internal error: Access violation
Panic: internal error:   $0000000000F1BC84
Panic: internal error:   $0000000000F1C727
Panic: internal error:   $0000000000F1C6A6
Panic: internal error:   $000000000094C502
Panic: internal error:   $000000000095164C

These do not show in the CLI compile and run.

rvk

  • Hero Member
  • *****
  • Posts: 3118
Re: in the IDE not getting an output
« Reply #11 on: February 14, 2018, 09:44:56 pm »
Panic: internal error: Access violation
Maybe your Lazarus installation is screwed up.
Kinda sounds like the same problem as here:
https://forum.lazarus.freepascal.org/index.php/topic,35743.0.html

Not sure what Linux version and Lazarus version you have (and how you installed it) but maybe installing it with fpcupdeluxe could help (it did in the other topic).


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus