The reprocessor macro cannot comprise charater and number by command line -d

General FreeBASIC programming questions.
Post Reply
yangdan_hz
Posts: 6
Joined: Feb 19, 2016 2:32

The reprocessor macro cannot comprise charater and number by command line -d

Post by yangdan_hz »

I need compile source file with command line -d=<XXXX>, if the XXXX comprises character and number, compiling will be failed.

For example, the test.bas is as follow:

Code: Select all

Print TEXT
fbc test.bas -d TEST="1234abcd"

The compiled result is :
test.bas(2) error 3: Expected End-of-Line, found 'abcd' in 'Print TEXT'

have I make some mistake?

Thank you!
SARG
Posts: 1767
Joined: May 27, 2005 7:15
Location: FRANCE

Re: The reprocessor macro cannot comprise charater and number by command line -d

Post by SARG »

Hi,

-d TEXT="1234abcd" is the same that -d TEXT=1234abcd, so use 3 double quotes before and after the string : TEXT="""1234abcd"""


With the compiler option -pp you can see the resulting source code.
"The -pp compiler option enables the preprocessor-only mode. The code is parsed & checked as usual, but is not compiled. A pre-processed version of every input source.bas is generated, named source.pp.bas."
yangdan_hz
Posts: 6
Joined: Feb 19, 2016 2:32

Re: The reprocessor macro cannot comprise charater and number by command line -d

Post by yangdan_hz »

Dear SARG,

bingo! Thank you very much!
Post Reply