10-05-2025, 06:52 AM
Your screen shots are of two different programs. Those programs aren't tied together in any way.
The second program has no DIM statement making the variable a STRING.
Try this
Now try this:
Did you get a single screen with "Hello World"?
Of course not! Those programs aren't tied together in any way and they're completely separate things.
But save the first one as "test.bas":
And now for the second one, make it:
Run the first one, and again you just get "Hello". There's no command in it linking anything else into it.
Run the second one, however, and it will print "Hello World". The first program is linked into it with the $INCLUDE statement.
That's what you're seeing.
You're writing a DIM statement in one program.
Trying to use that same variable in a completely different, unrelated program. It's not DIMmed there, so it defaults to a SINGLE variable type.
The second program has no DIM statement making the variable a STRING.
Try this
Code: (Select All)
PRINT "Hello"
Now try this:
Code: (Select All)
PRINT "World"
Did you get a single screen with "Hello World"?
Of course not! Those programs aren't tied together in any way and they're completely separate things.
But save the first one as "test.bas":
Code: (Select All)
PRINT "Hello"
And now for the second one, make it:
Code: (Select All)
$INCLUDE:'test.bas'
PRINT "World"
Run the first one, and again you just get "Hello". There's no command in it linking anything else into it.
Run the second one, however, and it will print "Hello World". The first program is linked into it with the $INCLUDE statement.
That's what you're seeing.
You're writing a DIM statement in one program.
Trying to use that same variable in a completely different, unrelated program. It's not DIMmed there, so it defaults to a SINGLE variable type.


