Author Topic: $INCLUDE <filename> issues  (Read 853 times)

jcfuller

  • Sr. Member
  • ****
  • Posts: 415
    • View Profile
$INCLUDE <filename> issues
« on: August 23, 2024, 03:02:41 PM »
Kevin,
NOT FIXED. Same issue
James

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2392
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #1 on: August 23, 2024, 03:21:35 PM »
Kevin,
NOT FIXED. Same issue
James

James,

I downloaded what I uploaded and extracted the latest Bc.exe.

It works with my A.bas - B.bas test and it works with Robert's test.

I need you to give me more to go on.
« Last Edit: August 23, 2024, 07:42:41 PM by MrBcx »

Robert

  • Hero Member
  • *****
  • Posts: 1256
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #2 on: August 23, 2024, 03:26:13 PM »
Fix works for me. Same output as 8.1.1.
« Last Edit: August 23, 2024, 07:42:54 PM by MrBcx »

jcfuller

  • Sr. Member
  • ****
  • Posts: 415
    • View Profile
Re: Re: $INCLUDE <filename> issues
« Reply #3 on: August 23, 2024, 04:16:58 PM »
Ok I think I have it.
See Help File $INCLUDE Syntax 3

James
« Last Edit: August 23, 2024, 07:43:18 PM by MrBcx »

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2392
    • View Profile
Re: Re: $INCLUDE <filename> issues
« Reply #4 on: August 23, 2024, 05:34:26 PM »

Ok I think I have it.
See Help File $INCLUDE Syntax 3

James

James -- You think you have it and I re-read the section on $Include syntax 3.

Now what?
« Last Edit: August 23, 2024, 07:43:34 PM by MrBcx »

jcfuller

  • Sr. Member
  • ****
  • Posts: 415
    • View Profile
Re: Re: $INCLUDE <filename> issues
« Reply #5 on: August 23, 2024, 06:47:45 PM »
Kevin,
  You are treating <  > the same as "  ".
BCXLIB needs to be defined for <  > to work correctly.

James
« Last Edit: August 23, 2024, 07:43:52 PM by MrBcx »

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2392
    • View Profile
Re: Re: $INCLUDE <filename> issues
« Reply #6 on: August 23, 2024, 07:37:35 PM »
Kevin,
  You are treating <  > the same as "  ".
BCXLIB needs to be defined for <  > to work correctly.

James

James,

SUB FindIncludeFiles(FileName$)    ' Added by MrBcx in 8.1.2

*  has absolutely -NOTHING- to do with BCXLIB
*  has absolutely -NOTHING- to do with the parsing and dispatch of $INCLUDE <filename>

Those tasks are accomplished inside FUNCTION Doinclude(szWord$, iFLAG AS PINT) which I did not write

I investigated the functioning of FUNCTION Doinclude by setting BCXLIB=C:\Foo\Bar\ and the code retrieved it
from the ENVIRON$() function and properly appended the sanitized filename to it. 
In other words, FUNCTION Doinclude() seems to be working as intended.

Which leaves me wondering whether you have correctly set BCXLIB to a valid path.

« Last Edit: August 23, 2024, 07:44:09 PM by MrBcx »

jcfuller

  • Sr. Member
  • ****
  • Posts: 415
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #7 on: August 24, 2024, 06:17:45 AM »
Kevin,
  All versions of BCX prior to 8.1.2 work.
I don't know what else to tell you but I'll putter a bit after breakfast.

James

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2392
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #8 on: August 24, 2024, 07:35:49 AM »
James,

You can try COMMENTING line 2749 and then rebuild.

CALL FindIncludeFiles (FileIn$)


If that solves your problem then I'll have a starting point to detect where it's going off the rails.

jcfuller

  • Sr. Member
  • ****
  • Posts: 415
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #9 on: August 24, 2024, 07:48:34 AM »
I'm not set up for a rebuild anymore.

This should show the issue with 8.1.3

Tested with version 8.1.1 GOOD and latest 8.1.3 -> BAD

Unzip keeping folders
I do not have bc.exe global

start a command prompt
and move to the IncTest folder

Change path for your machine.
SET BCXLIB=D:\IncTest\include\

Change path for your machine
D:\BcxAdp\bc temp.bas


James

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2392
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #10 on: August 24, 2024, 10:00:19 AM »
James,

I was wrong about SUB FindIncludeFiles not affecting the issue.

I isolated and corrected the problem with more robust testing. 

The new code inside SUB FindIncludeFiles will appear in 8.1.4 maybe later today.

Code: [Select]

IF INSTR(ThisFile$, "<") THEN                    ' Accomodate $INCLUDE < filename >
    LOCAL Tmp$                                   ' $INCLUDE <filename> requires
    ThisFile$ = REMOVE$(ThisFile$, ANY "<>")     ' an existing PATH set in the 
    ThisFile$ = TRIM$(ThisFile$)                 ' BCXLIB ENVIRON$ variable
    Tmp$ = ENVIRON$("BCXLIB")                    ' Test that it is there
    IF Tmp$ > "" THEN                            ' If it is ...
        ThisFile$ = ENVIRON$("BCXLIB")+ThisFile$ ' concat the filename
    ELSE                                         ' otherwise
        Abort("ENVIRON$(BCXLIB) is not SET")     ' report the issue
    END IF             '                         '
END IF                                           ' end -- $INCLUDE <filename>


jcfuller

  • Sr. Member
  • ****
  • Posts: 415
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #11 on: August 25, 2024, 08:05:24 AM »

With a small tweak to my code all is fine with 8.1.4 in limited testing

James


MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2392
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #12 on: August 25, 2024, 11:08:39 AM »

With a small tweak to my code all is fine with 8.1.4 in limited testing

James

James,

As we discussed, small tweaks relating to your reliance on ULEX, will be an ongoing fact of life.

Or until ULEX is refactored into something that is less brittle.


jcfuller

  • Sr. Member
  • ****
  • Posts: 415
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #13 on: August 26, 2024, 06:12:31 AM »
Kevin,
  I decided to take a look at the ULEX code and I found it can only be compiled with Pelles on my setup and batch files. The new chr$ breaks Mike Hennings InsertOptArg app which I use for "c" code.
I did a bit of web surfing this AM and it appears compiling "c" As "c++" is not as horrible as I thought, so I guess I can not considerate  chr$ a BUG. :)

James



MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 2392
    • View Profile
Re: $INCLUDE <filename> issues
« Reply #14 on: August 26, 2024, 11:37:34 AM »

... it appears compiling "c" As "c++" is not as horrible as I thought


When the C++ compiler writers stop supporting plain C on their compiler, you'll know it.