Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About Error C2081 Macro of declared symbol

Status
Not open for further replies.

jparadaa

Programmer
Jun 25, 2009
4
MX
Hi, I'm having an error when trying to compile
Clipper 5.2E on Windows Vista Home Premium SP2

The strange thing is that I have always been able to compile without any problem in another SO like Windows 98 or Windows XP

The error is: "Error: C2081 Macro of declared symbol: 'PrnDos & _ArchTxt'"

and this is where the line indicates the error:

SwpRunCmd ("PrnDos &_ArchTxt", 0,"","")

Have any idea because it appears this error

Thanks

Greetings
Javier Parada
 
Back to basics: What's the purpose of the & inside the quoted string? I do recall lots of DOS programs to support reading their parameters from a file, by specifying @filename, so did somebody by any chance use a wrong & instead of the expected @ ?
I can also remind some changes to the macro processor between Clipper 5.01 and 5.2, but can't recall the details. It might be that 5.2 also expands them inside strings, or did you try to 'concatenate' two string in VB-style?

Boils down to 'there might be a typo over here, somewhere', is the best I can come up with.

HTH
TonHu
 
Hi Javier

What happens if you:

xtmp='PrnDos &_ArchTxt'
SwpRunCmd (xtmp, 0,"","")

Jock
 
Thanks for answering TonHu, but sorry, I really do not understand your answer.

Jock, is exactly the same, throwing me this error when using the macro &.

What strange comment as I was running without any problem, even I have the same program to work with other clients, but I need to make modifications to the program for a particular client and when I try to compile the program marks the error mentioned above.

another idea.

Thank you

Greetings
Javier Parada
 
I suppose you could try something like this instead:
Code:
SwpRunCmd ("PrnDos " + chr(34)+"_ArchTxt", 0,"","")

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Ok, other questions:
- Is _ArchTxt a variable name in the program-code, or a filename on disk?
- Did somebody (anybody) modify the program-code, since the last successful compile session?
- What happens if you change the code to
Code:
SwpRunCmd ("PrnDos " + &(_ArchTxt), 0,"","")

HTH
TonHu
 
Thanks for answering, Griff, try as it just tells me to change the ASCII Chr(38), not Chr(34), at compile time and does not mark any error but it does not work as expected because it does not print.

Thanks for answering TonHu, _ArchTxt is a variable that contains the file name created temporarily as follows:

_ArchTxt := ArchRepPantalla( )

/***********
*
************/
Procedure ArchRepPantalla()
Local ArchPaso

ArchPaso := _Default+'\'+cLtrsSist+'TXT'+Right( Time(), 2) + '.Txt'
Do While File(ArchPaso)
ArchPaso := _Default+'\'+cLtrsSist+'TXT'+Right( Time(), 2) + '.Txt'

EndDo

Return( ArchPaso )
/********/

Answering your questions, I am the only developer to modify the program, and if I try to compile, changing the line as you propose it, do not check error in compilation, but in execution mark syntax error just with &

Thanks for your suggestions but I do not really understand what is happening and I can not think of some other solutions

Thank you

Greetings
Javier Parada
 
Ahhh... so you DO WANT to do a macro expansion.

You probably need this:

Code:
SwpRunCmd ("PrnDos " + _ArchTxt, 0,"","")

Or perhaps:
Code:
SwpRunCmd ('PrnDos "' + _ArchTxt + '"', 0,"","")

To allow for spaces in the path to the text file.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Thank you very much Griff and other colleagues, it worked, thus:

Code:
SwpRunCmd ("PrnDos " + _ArchTxt, 0,"","")

The truth then I guess I was too complicated to attempt to use the macro.

Greetings
Javier Parada
 
No problem.
Glad to be of help.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top