Recent

Author Topic: Comparing text output (devices/handles)  (Read 119 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 1451
Comparing text output (devices/handles)
« on: October 02, 2020, 11:10:10 am »
I've got

Code: [Select]
var
  statusText: Text;
...
  statusText := ErrOutput;

and then am later assigning statusText to a logfile if possible. The compiler objects if I try to compare statusText to the original ErrOutput device to see whether the assignment was actually done.


watchp0xcode.pas(1341,14) Error: Incompatible types: got "Text" expected "Int64"


The app is on Linux, but is there a "right" way of comparing text devices/handles?

(Later:) For the moment at least I'm using code as below, and have verified that on Linux initialisation (as shown above) sets the .Handle field to the same handle rather than to a duplicate (i.e. different numeric value but referring to the same device).

Code: [Select]
          if TextRec(statusText).Handle <> TextRec(ErrOutput).Handle then
...

MarkMLl
« Last Edit: October 02, 2020, 03:36:05 pm by MarkMLl »
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

 

TinyPortal © 2005-2018