Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sub not Reconizing Dim as String
#8
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

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.
Reply


Messages In This Thread
Sub not Reconizing Dim as String - by pmackay - 10-05-2025, 12:25 AM
RE: Sub not Reconizing Dim as String - by bplus - 10-05-2025, 12:44 AM
RE: Sub not Reconizing Dim as String - by bplus - 10-05-2025, 01:47 AM
RE: Sub not Reconizing Dim as String - by pmackay - 10-05-2025, 04:21 AM
RE: Sub not Reconizing Dim as String - by pmackay - 10-05-2025, 04:37 AM
RE: Sub not Reconizing Dim as String - by pmackay - 10-05-2025, 05:46 AM
RE: Sub not Reconizing Dim as String - by SMcNeill - 10-05-2025, 06:52 AM
RE: Sub not Reconizing Dim as String - by pmackay - 10-05-2025, 07:58 AM
RE: Sub not Reconizing Dim as String - by bplus - 10-05-2025, 01:38 PM
RE: Sub not Reconizing Dim as String - by pmackay - 10-05-2025, 01:40 PM
RE: Sub not Reconizing Dim as String - by bplus - 10-05-2025, 01:55 PM
RE: Sub not Reconizing Dim as String - by bplus - 10-05-2025, 03:21 PM
RE: Sub not Reconizing Dim as String - by pmackay - 10-16-2025, 11:18 AM
RE: Sub not Reconizing Dim as String - by bplus - 10-16-2025, 11:54 AM
RE: Sub not Reconizing Dim as String - by pmackay - 10-16-2025, 01:41 PM
RE: Sub not Reconizing Dim as String - by pmackay - 10-16-2025, 03:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Experimenting with a "StringList" type for simpler handling of string arrays/lists Heimdall 18 1,184 12-19-2025, 12:51 PM
Last Post: Heimdall
  Illegal string-number conversion Herve 7 759 07-07-2025, 09:53 AM
Last Post: a740g
  need help printing a scaled string in a custom font to a 32-bit image madscijr 9 1,147 07-03-2025, 04:48 PM
Last Post: SMcNeill
  DIM - AS - VARIABLE TYPE likely bug bartok 25 5,424 05-06-2024, 08:21 PM
Last Post: SMcNeill
  How to reorder string variable x factorial different ways? Circlotron 13 2,617 04-27-2024, 02:43 AM
Last Post: PhilOfPerth

Forum Jump:


Users browsing this thread: