Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read a text and attribute it to a variable
#6
Wait, I'll try to explain!

The code I had proposed was kept to a minimum, just to make the problem clear without giving too much weight to the code itself.

The TEST.BAS file is a simple text file (perhaps better called TST.TXT) and contains only one line.
Including the quotation marks, the line is as follows:
"QB64 Phoenix "+CHR$(138)+" (is) beatiful"

The code that opens and reads the file loads the entire line and puts it in the j$ variable.
The problem - but maybe it's me who doesn't see something obvious - is that the compiler (or I don't know what else) doesn't recognize the instructions.

In fact, if you were to write and compile this line of code:
j$= "QB64 Phoenix "+CHR$(138)+" (is) beatiful"

I get:
QB64 Phoenix รจ (is) beatiful

Instead, reading the line from the file and assigning it to j$ - running the compiled code - I just only get:
"QB64 Phoenix "+CHR$(138)+" (is) beatiful"
Reply


Messages In This Thread
RE: Read a text and attribute it to a variable - by krovit - 11-24-2023, 12:45 PM



Users browsing this thread: 9 Guest(s)