Recent

Author Topic: while loop with code before comparison  (Read 7717 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: while loop with code before comparison
« Reply #45 on: August 13, 2020, 01:54:24 pm »
For example I would like to have the possibility of this:

Code: Pascal  [Select][+][-]
  1. Program inextended;
  2. ...
  3. uses
  4. myunit in '../mydir/myotherdir', ...

This should work:

Code: Pascal  [Select][+][-]
  1. uses
  2.   myunit in '../mydir/myotherdir/myunit.pas';

This is Delphi compatible.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: while loop with code before comparison
« Reply #46 on: August 13, 2020, 02:43:11 pm »
[EDIT: I deleted my previous posts because wrong compilation]

Yep, that works, even in objpas mode:

Code: Pascal  [Select][+][-]
  1.     unit test;
  2.      
  3.     {$IFDEF FPC}{$MODE objpas}{$H+}{$ENDIF}
  4.      
  5.     interface
  6.      
  7.     uses
  8.     bgrabitmap in '/home/fred/bgrabitmap-dev-bgrabitmap/bgrabitmap/bgrabitmap.pas', ...

OK and excellent.

By the way I will not be against:

Code: Pascal  [Select][+][-]
  1. uses
  2. mayunit in '/my/directory/';
« Last Edit: August 13, 2020, 02:50:24 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: while loop with code before comparison
« Reply #47 on: August 14, 2020, 02:57:00 am »
By the way I will not be against:
Code: Pascal  [Select][+][-]
  1. uses
  2. mayunit in '/my/directory/';

That's what the compiler's "unit search path" is for, though I agree it might be nice to be able to do it in code to, for example, activate temporarily alternative versions instead of the default units or tricks like that ;)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018