$INCLUDE <filename> issues

Started by jcfuller, August 23, 2024, 03:02:41 PM

Previous topic - Next topic

MrBcx

Quote from: jcfuller on August 26, 2024, 06:12:31 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.


jcfuller

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

Quote from: jcfuller 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

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


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

James


MrBcx

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.



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

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

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

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

#7
Quote from: jcfuller 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

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.


jcfuller

#6
Kevin,
  You are treating <  > the same as "  ".
BCXLIB needs to be defined for <  > to work correctly.

James

MrBcx

#5
Quote from: jcfuller on August 23, 2024, 04:16:58 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?

jcfuller

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

James

Robert

#3
Fix works for me. Same output as 8.1.1.

MrBcx

#2
Quote from: jcfuller on August 23, 2024, 03:02:41 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.

jcfuller

Kevin,
NOT FIXED. Same issue
James