-pp compiler option

Forum for discussion about the documentation project.
dodicat
Posts: 4419
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: -pp compiler option

Postby dodicat » Nov 11, 2017 12:36

Yea thanks fxm.
I was also a bit ratty with Josep Roca in the other post, also regarding -pp.
You could perhaps add as a footnote to the -pp help
Warning: repeated use of -pp has been known to cause bad temper and aloofness.
deltarho[1859]
Posts: 671
Joined: Jan 02, 2017 0:34
Location: UK

Re: -pp compiler option

Postby deltarho[1859] » Nov 11, 2017 12:50

dodicat wrote:I am not keen on being moderated by the hoi polloi.

Funny you should mention that because I am not overly keen either.
Warning: repeated use of -pp has been known to cause bad temper and aloofness.

Alternatively, "To be used in moderation" <grin>
St_W
Posts: 1127
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: -pp compiler option

Postby St_W » Nov 12, 2017 14:07

<ot>
@dodicat: whether you want to be constructive or destructive is your decision - only your decision. There's practically no moderation on this forum so you can say nearly anything without having to fear any consequences. I just try to encourage people to take part in discussions in a constructive fashion, but unfortunately that doesn't always work out as intended :-|
</ot>
deltarho[1859]
Posts: 671
Joined: Jan 02, 2017 0:34
Location: UK

Re: -pp compiler option

Postby deltarho[1859] » Nov 12, 2017 18:33

St_W wrote:There's practically no moderation on this forum so you can say nearly anything without having to fear any consequences.

What a sorry state of affairs.
sancho3
Posts: 36
Joined: Sep 30, 2017 3:22

Re: -pp compiler option

Postby sancho3 » Nov 12, 2017 19:52

Following up on DKL's suggestion for an example I propose something like this:

Code: Select all

' FileA.bas
#Define txt(n) "File" + n
Print "Hello from " + txt("A")

Code: Select all

' FileB.bas
#Macro From(n)
   Print "Hello again from " + n
#EndMacro
From("FileB")

Code: Select all

' FileC.bas
#Include "FileA.bas"
#Include "FileB.bas"
From("FileC")
Print "Goodbye from " + txt("C")

Code: Select all

' Resulting FileC.pp.bas file
Print "Hello from " + "File" + "A"


 Print "Hello again from " + "FileB"
 Print "Hello again from " + "FileC"
Print "Goodbye from " + "File" + "C"

I see that -pp inserts lines after expanding the #includes, and indents code expanded from #macro. I am not sure if that can be cleaned up.

EDIT: I fixed an error in the macro 'From'
Off topic a bit, is it a known issue that the following does not return an error?

Code: Select all

print "a" "b" "c"
Last edited by sancho3 on Nov 13, 2017 5:03, edited 2 times in total.
Boris the Old
Posts: 110
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: -pp compiler option

Postby Boris the Old » Nov 13, 2017 3:41

fxm wrote:
dodicat wrote:I am not keen on being moderated by the hoi polloi.
    vocabulary.com wrote:The hoi polloi is a way of referring to common people, and it is an elitist term usually used by people who consider themselves to be above the masses.
    :-(


And it's also a derogatory term commonly used by the plebs to describe the elitists who are deservingly above them. :-)

And by the way, why not just say that the -pp compiler option suppresses the actual compile, and creates a copy of the source file that shows the contents of the include statements and the code generated by the macros. There's really not much more to say about it.

Rod
fxm
Posts: 7373
Joined: Apr 22, 2009 12:46
Location: Paris suburb, FRANCE

Re: -pp compiler option

Postby fxm » Nov 13, 2017 8:26

Boris the Old wrote:
fxm wrote:And by the way, why not just say that the -pp compiler option suppresses the actual compile, and creates a copy of the source file that shows the contents of the include statements and the code generated by the macros. There's really not much more to say about it.

I think that's what's written now in the manual (Compiler Option: -pp)
Me too, I think that's enough!

Return to “Documentation”

Who is online

Users browsing this forum: No registered users and 1 guest