QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Unseen Machine on June 21, 2020, 03:39:37 am

Title: Feature request - _IF_NOT_INCLUDED
Post by: Unseen Machine on June 21, 2020, 03:39:37 am
Hi Felippe,

Is it possible to add a feature to the ide that will allow us to have multiple $INCLUDE references to the same file? Basically something like

Code: QB64: [Select]
  1. _IF_NOT_INCLUDED "GDK_GL.BI' THEN $INCLUDE:'GDK.GL.bi'
  2.  

If it is then sweet! Could the same trick be applied to varible declerations aswell?

Thanks

Unseen
Title: Re: Feature request - _IF_NOT_INCLUDED
Post by: luke on June 21, 2020, 03:59:32 am
Surely you can fake it by doing something with the pre-compiler:
Code: [Select]
$IF A THEN
    DIM x AS INTEGER
$END IF
$LET A = -1
Title: Re: Feature request - _IF_NOT_INCLUDED
Post by: SMcNeill on June 21, 2020, 04:19:16 am
Surely you can fake it by doing something with the pre-compiler:
Code: [Select]
$IF A THEN
    DIM x AS INTEGER
$END IF
$LET A = -1

$IF FLAG = UNDEFINED THEN
    $LET FLAG = TRUE
   .... More stuff
$END IF

(After all, you never know when someone might $LET FLAG = 0.  Checking to see if it's defined or undefined is generally the better way to go, in these cases.)
Title: Re: Feature request - _IF_NOT_INCLUDED
Post by: FellippeHeitor on June 21, 2020, 06:28:48 am
Same precompiler trick will work for the $INCLUDE "exclusion". You've got yourself a feature request implemented, Unseen.
Title: Re: Feature request - _IF_NOT_INCLUDED
Post by: Unseen Machine on June 21, 2020, 06:59:33 am
Quote
Same precompiler trick will work for the $INCLUDE "exclusion". You've got yourself a feature request implemented, Unseen.

Thats great! Now I can actually rebuild GDK/GDK_GL and VQB as I wanted to! I've been working on seperating GDK_GL functions into independant libraries so i can get them as close to class structures as QB64 allows (i'll be doing this with GDK and VQB too). Not being able to reference the same dependancies was proving a major hinderence so thank you Fellippe!

Unseen
Title: Re: Feature request - _IF_NOT_INCLUDED
Post by: FellippeHeitor on June 21, 2020, 07:04:39 am
Thanks to Steve for adding in the precompiler bit.
Title: Re: Feature request - _IF_NOT_INCLUDED
Post by: Unseen Machine on June 21, 2020, 07:16:55 am
Quote
Thanks to Steve for adding in the precompiler bit.

Yep, thanks to you all really, i certainly didnt expect such a quick response.

Many thanks folks and happy coding!

Unseen