Author | Topic: Pre processor error | |
---|---|---|
Carlos A Beling | Pre processor error on Mon, 22 Jun 2009 12:07:47 -0300 Hello: good morning. I'm back again. I sent to the Alaska support team the first one example tat I posted in the thread that I started in a Generic NG in 17.06.2009 at 11:12 AM. Today I am opening a new one thread here because it has a problem or in the documentation or in the implementation of the restrict match marker that I ask you to try help me solve the problem . The docs says: <start> Restricted match marker <Symbol:Wordlist> consists of a symbol followed by a comma separated list of keywords. If the preprocessor matches one of the keywords, the expression following the keyword is assigned to the match marker symbol. If none of the keywords is found, the match marker symbol is not assigned a value. The Restricted match marker is typically implemented as a single keyword that expects no argument, and paired with a Logify result marker. In this way, the Logify result marker will be .T. (true) if the user enters the keyword, otherwise it will be .F. (false). An example of this can be found in the command SET PRINTER TO. That command has an optional clause ADDITIVE, implemented as a Restricted match marker. If the ADDITIVE clause is present, a .T. (true) value is passed as one of the arguments to the function call written out by the replacement rule. Otherwise, the function call is passed a .F. (false) value for this argument. </start> I attached a new one program test (Why3.prg) that made me thinking that the list of keyword is restricted in only two words. Compiling it with Clipper and Xbase++ I got diferent error messages and Xbase++ ommited one of them. Can one compile it, comparing the ppo file of both languages and advise some workaround? Saying do not use it does not mather. Beling TIA Why3.PRG | |
Rodd Graham | Re: Pre processor error on Mon, 22 Jun 2009 21:59:12 +0000 Hello Carlos, > I attached a new one program test (Why3.prg) that made me thinking > that the list of keyword is restricted in only two words. Is this Why3.prg intentionally defective? > Compiling it with Clipper and Xbase++ I got diferent error messages > and Xbase++ ommited one of them. Are you trying to establish simultaneous syntax compatibility between Clipper and Xbase? > Can one compile it, comparing the ppo file of both languages and > advise some workaround? Without changing your #command/translate directives the code can be fixed: PROCEDURE Main(xParam) LOCAL cMistery testing PREPRO cMistery; //WHY ARE YOU OMITTING 'TESTING' KEYWORD? DESCRIPTION 'What Will be?'; EXITFORMBOTTOM YES testing PREPRO cMistery; //WHY ARE YOU OMITTING 'TESTING' KEYWORD? DESCRIPTION 'What Will be?'; EXITFORMBOTTOM & Set Printer on Set Print third //WHAT WAS 'YES' KEYWORD??? NO MATCH IN DIRECTIVES Set MyPrinter LOC RETURN As an additional note, the second #command below completely covers and supercedes the first. Hence the first #command is dead code. #command SET PRINTER <x:ON,OFF,&> => Set( _SET_PRINTER, <(x)> ) #command SET PRINT <x:ON,OFF,THIRD,&> => Set( _SET_PRINTER, <"x"> ) Regards, Rodd Graham, Consultant Graham Automation Systems, LLC | |
Carlos A Beling | Re: Pre processor error on Tue, 23 Jun 2009 12:44:39 -0300 Hello Rodd: I thank you again. Please see more below. Please see what madness in the pictures that I attached: . ErrorWithNo.jpg - the program was compiled and give an error when EXITFORMBOTTOM was NO . NoErrorWithAlert.pjg - the same source was compiled and did not an error when EXITFORMBOTTOM was ALERT . ClipperWhy3.jpg - the test program was compiled ok in command line with Clipper . XppWhy3.jpg - the same with Xpp . ClipperSourceError.jpg - error while compiling the Source program (see NoErrorWithAlert.jpg) with Clipper . XppSourceError.jpg - the same with Xpp . Why3.prg the program that has snips of the header file and the source file That's why I am understanding nothing. Belin Best regards Rodd Graham escreveu: > Hello Carlos, > >> I attached a new one program test (Why3.prg) that made me thinking >> that the list of keyword is restricted in only two words. > > Is this Why3.prg intentionally defective? No > >> Compiling it with Clipper and Xbase++ I got diferent error messages >> and Xbase++ ommited one of them. > > Are you trying to establish simultaneous syntax compatibility between > Clipper and Xbase? Sometimes I need to do this looking for mistakes > >> Can one compile it, comparing the ppo file of both languages and >> advise some workaround? > > Without changing your #command/translate directives the code can be > fixed: > > PROCEDURE Main(xParam) > LOCAL cMistery > > testing PREPRO cMistery; //WHY ARE YOU OMITTING 'TESTING' KEYWORD? > DESCRIPTION 'What Will be?'; > EXITFORMBOTTOM YES > > testing PREPRO cMistery; //WHY ARE YOU OMITTING 'TESTING' KEYWORD? > DESCRIPTION 'What Will be?'; > EXITFORMBOTTOM & > > Set Printer on > Set Print third //WHAT WAS 'YES' KEYWORD??? NO MATCH IN > DIRECTIVES > Set MyPrinter LOC > > RETURN > > As an additional note, the second #command below completely covers and > supercedes the first. Hence the first #command is dead code. I compiled it and Xbase++ did not gave me an error > > #command SET PRINTER <x:ON,OFF,&> => Set( _SET_PRINTER, <(x)> ) > > #command SET PRINT <x:ON,OFF,THIRD,&> => Set( _SET_PRINTER, <"x"> ) These commands are in STD.ch > > Regards, > > Rodd Graham, Consultant > Graham Automation Systems, LLC > > ErrorWithNo.jpg NoErrorWithAlert.jpg ClipperWhy3.jpg XppWhy3.jpg ClipperSourceError.jpg XppSourceError.jpg WHY3.PRG | |
Andreas Gehrs-Pahl | Re: Pre processor error on Wed, 24 Jun 2009 05:07:31 -0400 Carlos, Instead of a bunch of pictures, could you post the actual program and/or the actual PPO file, so we can see what the problem might be? Your attached "Why3.prg" program compiles fine for me, as it apparently did for you. But because it is obviously not the same program that is shown in your pictures, this really isn't all that helpful. The problem is probably somewhere else in your "cabentry.prg" file or maybe in one of the included files. So, the only practical way that we could help you, is for you to provide us with the actual files that do create the errors -- not a different file, which doesn't show the error! Otherwise we are just wasting time. -- Andreas --- --- Andreas Gehrs-Pahl E-Mail: GPahl@CharterMI.net 415 Gute Street or: Andreas@DDPSoftware.com Owosso, MI 48867-4410 or: Andreas_Gehrs-Pahl@CrimeCog.com Tel: (989) 723-9927 Web Site: http://www.Aerospace-History.net --- --- | |
Carlos A Beling | Re: Pre processor error on Wed, 24 Jun 2009 12:29:45 -0300 Hello Andreas: good afternoon; I attached the complete program for being compiled ant the header files, sorry because it is very big and was written many time ago. It gives compilation errors that I can not understanding, different in Clipper and Xbase++ (what I think might to be the same). I use for compiling: xpp CabEntry -a -m -n -q -w -wu -err:600 -p ..\Clipper CabEntry -p Any comments will be welcome. Beling TIA Andreas Gehrs-Pahl escreveu: > Carlos, > > Instead of a bunch of pictures, could you post the actual program and/or > the actual PPO file, so we can see what the problem might be? > > Your attached "Why3.prg" program compiles fine for me, as it apparently > did for you. But because it is obviously not the same program that is > shown in your pictures, this really isn't all that helpful. > > The problem is probably somewhere else in your "cabentry.prg" file or > maybe in one of the included files. So, the only practical way that we > could help you, is for you to provide us with the actual files that do > create the errors -- not a different file, which doesn't show the error! > > Otherwise we are just wasting time. > > -- Andreas > > --- --- > Andreas Gehrs-Pahl E-Mail: GPahl@CharterMI.net > 415 Gute Street or: Andreas@DDPSoftware.com > Owosso, MI 48867-4410 or: Andreas_Gehrs-Pahl@CrimeCog.com > Tel: (989) 723-9927 Web Site: http://www.Aerospace-History.net > --- --- > | |
Andreas Gehrs-Pahl | Re: Pre processor error on Wed, 24 Jun 2009 14:24:54 -0400 Carlos, >I attached the complete program for being compiled ant the header files, I guess you forgot the attachment! -- Andreas --- --- Andreas Gehrs-Pahl E-Mail: GPahl@CharterMI.net 415 Gute Street or: Andreas@DDPSoftware.com Owosso, MI 48867-4410 or: Andreas_Gehrs-Pahl@CrimeCog.com Tel: (989) 723-9927 Web Site: http://www.Aerospace-History.net --- --- | |
Carlos A Beling | Re: Pre processor error on Thu, 25 Jun 2009 11:42:38 -0300 Wow: forgot again. :-[ But here it is. Beling Best regards Carlos A Beling escreveu: > Hello Andreas: > good afternoon; > I attached the complete program for being compiled ant the header > files, sorry because it is very big and was written many time ago. It > gives compilation errors that I can not understanding, different in > Clipper and Xbase++ (what I think might to be the same). > I use for compiling: > xpp CabEntry -a -m -n -q -w -wu -err:600 -p > ..\Clipper CabEntry -p > Any comments will be welcome. > > Beling > TIA > > > Andreas Gehrs-Pahl escreveu: >> Carlos, >> >> Instead of a bunch of pictures, could you post the actual program and/or >> the actual PPO file, so we can see what the problem might be? >> >> Your attached "Why3.prg" program compiles fine for me, as it >> apparently did for you. But because it is obviously not the same >> program that is shown in your pictures, this really isn't all that >> helpful. >> >> The problem is probably somewhere else in your "cabentry.prg" file or >> maybe in one of the included files. So, the only practical way that we >> could help you, is for you to provide us with the actual files that do >> create the errors -- not a different file, which doesn't show the error! >> >> Otherwise we are just wasting time. >> >> -- Andreas >> >> --- >> --- >> Andreas Gehrs-Pahl E-Mail: GPahl@CharterMI.net >> 415 Gute Street or: Andreas@DDPSoftware.com >> Owosso, MI 48867-4410 or: >> Andreas_Gehrs-Pahl@CrimeCog.com >> Tel: (989) 723-9927 Web Site: >> http://www.Aerospace-History.net >> --- >> --- >> BIGWHY.ZIP | |
Andreas Gehrs-Pahl | Re: Pre processor error on Thu, 25 Jun 2009 12:45:13 -0400 Carlos, As I suspected, if you look at the PPO file, you can see why it isn't working. For example, the following three lines (1334-1337): >cabEntry CREATE FORM oBrow:Cargo[O_FORM]; > EXITFORMBOTTOM NO; > SAMEDESCRIPT .t. Are translated to: >oBrow:Cargo[19 ] := EditForm_(,,,,,,,,,,,,,,,,)EXITFORMBOTTOM .F. SAMEDESCRIPT .t. Instead of: >oBrow:Cargo[19 ] := EditForm_(,,,,,,,,,,,,,,.t.,"NO",) The reason is simple -- "NO" is replaced with ".F." by the following directive: >#define NO .F. Which is in line 23 of "Common.ch", which you include in "MCB.ch". To fix this, you have several options: Don't include "Common.ch" or remove the offending define constant with: >#ifdef NO > #undef NO >#endif Or, even simpler, just use a lower or mixed case "No" in your commands. The following command will compile just fine: >cabEntry CREATE FORM oBrow:Cargo[O_FORM]; > EXITFORMBOTTOM No; > SAMEDESCRIPT .t. So, the most important thing to learn from this: Always check the PPO file, so you know what the pre-processor makes out of your code. Hope that helps. -- Andreas --- --- Andreas Gehrs-Pahl E-Mail: GPahl@CharterMI.net 415 Gute Street or: Andreas@DDPSoftware.com Owosso, MI 48867-4410 or: Andreas_Gehrs-Pahl@CrimeCog.com Tel: (989) 723-9927 Web Site: http://www.Aerospace-History.net --- --- | |
Carlos A Beling | Re: Pre processor error on Thu, 25 Jun 2009 15:42:03 -0300 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hello Andreas:<br> good afternoon.<br> Many thanks. I never could imagine that they could do that in common.ch.<br> <br> Beling<br> Best regards<br> <br> Andreas Gehrs-Pahl escreveu: <blockquote cite="mid:prhpaagf95pg$.lypgw16w61u9.dlg@40tude.net" type="cite"> <pre wrap="">Carlos, As I suspected, if you look at the PPO file, you can see why it isn't working. For example, the following three lines (1334-1337): </pre> <blockquote type="cite"> <pre wrap="">cabEntry CREATE FORM oBrow:Cargo[O_FORM]; EXITFORMBOTTOM NO; SAMEDESCRIPT .t. </pre> </blockquote> <pre wrap=""><!----> Are translated to: </pre> <blockquote type="cite"> <pre wrap="">oBrow:Cargo[19 ] := EditForm_(,,,,,,,,,,,,,,,,)EXITFORMBOTTOM .F. SAMEDESCRIPT .t. </pre> </blockquote> <pre wrap=""><!----> Instead of: </pre> <blockquote type="cite"> <pre wrap="">oBrow:Cargo[19 ] := EditForm_(,,,,,,,,,,,,,,.t.,"NO",) </pre> </blockquote> <pre wrap=""><!----> The reason is simple -- "NO" is replaced with ".F." by the following directive: </pre> <blockquote type="cite"> <pre wrap="">#define NO .F. </pre> </blockquote> <pre wrap=""><!----> Which is in line 23 of "Common.ch", which you include in "MCB.ch". To fix this, you have several options: Don't include "Common.ch" or remove the offending define constant with: </pre> <blockquote type="cite"> <pre wrap="">#ifdef NO #undef NO #endif </pre> </blockquote> <pre wrap=""><!----> Or, even simpler, just use a lower or mixed case "No" in your commands. The following command will compile just fine: </pre> <blockquote type="cite"> <pre wrap="">cabEntry CREATE FORM oBrow:Cargo[O_FORM]; EXITFORMBOTTOM No; SAMEDESCRIPT .t. </pre> </blockquote> <pre wrap=""><!----> So, the most important thing to learn from this: Always check the PPO file, so you know what the pre-processor makes out of your code. Hope that helps. -- Andreas --- --- Andreas Gehrs-Pahl E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:GPahl@CharterMI.net">GPahl@CharterMI.net</a> 415 Gute Street or: <a class="moz-txt-link-abbreviated" href="mailto:Andreas@DDPSoftware.com">Andreas@DDPSoftware.com</a> Owosso, MI 48867-4410 or: <a class="moz-txt-link-abbreviated" href="mailto:Andreas_Gehrs-Pahl@CrimeCog.com">Andreas_Gehrs-Pahl@CrimeCog.com</a> Tel: (989) 723-9927 Web Site: <a class="moz-txt-link-freetext" href="http://www.Aerospace-History.net">http://www.Aerospace-History.net</a> --- --- </pre> </blockquote> </body> </html> |