INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

About Error C2081 Macro of declared symbol

About Error C2081 Macro of declared symbol

(OP)
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

RE: About Error C2081 Macro of declared symbol

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

RE: About Error C2081 Macro of declared symbol

Hi Javier

What happens if you:

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

Jock

RE: About Error C2081 Macro of declared symbol

(OP)
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

RE: About Error C2081 Macro of declared symbol

I suppose you could try something like this instead:

CODE

SwpRunCmd ("PrnDos " + chr(34)+"_ArchTxt", 0,"","")

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: About Error C2081 Macro of declared symbol

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

RE: About Error C2081 Macro of declared symbol

(OP)
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

RE: About Error C2081 Macro of declared symbol

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 Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: About Error C2081 Macro of declared symbol

(OP)
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

RE: About Error C2081 Macro of declared symbol

No problem.
Glad to be of help.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close