Recent

Author Topic: How to shutdown computer when idle  (Read 1810 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 15649
  • Censorship about opinions does not belong here.
Re: How to shutdown computer when idle
« Reply #15 on: August 13, 2024, 06:16:56 pm »
If you used the exact same code from me or the example from the manuals it should not crash.
Please file a bug report against the documentation example. Both should work, the example from the docs has been working for years. It is standard Linux.
If you did not use the exact code, don't do that.
« Last Edit: August 13, 2024, 06:18:57 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

Thaddy

  • Hero Member
  • *****
  • Posts: 15649
  • Censorship about opinions does not belong here.
Re: How to shutdown computer when idle
« Reply #16 on: August 13, 2024, 06:18:23 pm »
You should never ignore errors in this case, but be exact.
If I smell bad code it usually is bad code and that includes my own code.

ginoo

  • Jr. Member
  • **
  • Posts: 82
Re: How to shutdown computer when idle
« Reply #17 on: August 13, 2024, 06:29:54 pm »
I attach image with source and error. Should this be reported?

Thaddy

  • Hero Member
  • *****
  • Posts: 15649
  • Censorship about opinions does not belong here.
Re: How to shutdown computer when idle
« Reply #18 on: August 13, 2024, 06:36:20 pm »
Are you using by any chance {$mode delphi} instead of {$mode objfpc} in your program?
What happens if you explicitly define {$mode objfpc}{$H+} ?
« Last Edit: August 13, 2024, 06:38:35 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

ginoo

  • Jr. Member
  • **
  • Posts: 82
Re: How to shutdown computer when idle
« Reply #19 on: August 13, 2024, 06:44:18 pm »
I tried putting {$mode delphi}, then {$mode objfpc}, then {$mode objfpc}{$H+} in each case it gives that error. Then pressing F9 continues execution.

Thaddy

  • Hero Member
  • *****
  • Posts: 15649
  • Censorship about opinions does not belong here.
Re: How to shutdown computer when idle
« Reply #20 on: August 13, 2024, 07:20:22 pm »
Does it execute correctly? If so it is a Mint issue (not for the first time Mint isn't really .. well, mint.. :-X )
If I smell bad code it usually is bad code and that includes my own code.

ginoo

  • Jr. Member
  • **
  • Posts: 82
Re: How to shutdown computer when idle
« Reply #21 on: August 13, 2024, 07:28:49 pm »
Yes, I had written that before as well, but maybe I explained it wrong. You launch the program, then on the return of the fpPause instruction comes up with that error shown in the image, then pressing the F9 key continues execution.

 

TinyPortal © 2005-2018