Author Topic: Feature request - _IF_NOT_INCLUDED  (Read 3658 times)

0 Members and 1 Guest are viewing this topic.

Offline Unseen Machine

  • Forum Regular
  • Posts: 158
  • Make the game not the engine!
    • View Profile
Feature request - _IF_NOT_INCLUDED
« 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
« Last Edit: June 21, 2020, 03:45:45 am by Unseen Machine »

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: Feature request - _IF_NOT_INCLUDED
« Reply #1 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

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Feature request - _IF_NOT_INCLUDED
« Reply #2 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.)
« Last Edit: June 21, 2020, 04:21:44 am by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: Feature request - _IF_NOT_INCLUDED
« Reply #3 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.

Offline Unseen Machine

  • Forum Regular
  • Posts: 158
  • Make the game not the engine!
    • View Profile
Re: Feature request - _IF_NOT_INCLUDED
« Reply #4 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

FellippeHeitor

  • Guest
Re: Feature request - _IF_NOT_INCLUDED
« Reply #5 on: June 21, 2020, 07:04:39 am »
Thanks to Steve for adding in the precompiler bit.

Offline Unseen Machine

  • Forum Regular
  • Posts: 158
  • Make the game not the engine!
    • View Profile
Re: Feature request - _IF_NOT_INCLUDED
« Reply #6 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