Posted by Greensands on 03/03/2020 10:24:06:
Have not tried using the Hexdump approach yet but have tried checking the LEN of a string containing a known of characters without any indication of hidden characters.
E.g TEST$="123456789" N%=LEN(TEST$) PRINT N% gives a value of 9
If it's not a hidden character in the string, and the syntax is correct (I believe it is), then probably something to do with the environment.
Which version of TurboBASIC and what are you running it on?
There are many differences between the original 1980's TurboBASIC for MS-DOS, and the current PowerBASIC (version 6) for Windows. The Windows versions added a lot of functionality – the Manual for V4 is about 600 pages, V6 is over 3000 pages.
How exactly is the program run? Assuming it's an early Borland TurboBASIC, unless you have a genuine MSDOS machine, the problem may be in the console emulation that modern Windows uses to simulate an MS-DOS screen. The later Windows PowerBASIC can talk direct to Windows graphics, but it too has a console emulator for character mode.
To eliminate screen display side-effects try PRINT to a file:
OPEN "TEST.DTA" FOR OUTPUT AS #1
PRINT #1, "Hello";
PRINT #1, " World"
CLOSE 1
If the contents of the file are "Hello World", then the problem is in the console emulator, might be a setting.
Very mysterious. A workaround might be to concatenate the strings rather than have a series of print statements, as in
S1$ = "Hello"
S2$ = " World"
BOTH$ = S1$ + S2$
PRINT BOTH$
As always more information would help; can you share any of the actual code? How the array is set, and any processing done to the strings before the offending PRINT might contain a clue.
Dave