Page 3 of 3
Posted: Mon Feb 23, 2009 6:23 pm
by Blue
Little John wrote:Hi all,
now there is a new version, which can handle include files!
Please look at the first post in this thread.
Thanks for your attention, Little John
Nice to see that you're still sweating at the drawing board, Little John.
I'll give your most recent version a spin, as soon as I have some time to breathe.
Posted: Sat Feb 28, 2009 2:54 pm
by Little John
Hi Blue,
thanks for your message. Now there is version 0.60 hot off the press.
Best regards, Little John
LPP (or LLP)
Posted: Mon May 18, 2009 10:10 am
by somic
Great code!!!
Now I see some more light...
Thanks a lot to all of you.
I feel the difference between:
Code: Select all
fSuccess = WriteFile_(
hPipe, ; handle To pipe
pchReply, ; buffer To write from
cbReplyBytes, ; number of bytes To write
&cbWritten, ; number of bytes written
#NULL); ; not overlapped I/O
and
Code: Select all
fSuccess = WriteFile_(hPipe, pchReply, cbReplyBytes, &cbWritten, #NULL)
Regards,
Somic
Posted: Sun Jun 14, 2009 6:46 pm
by somic
Little John,
thank you for the great work.
In my system your preprocessor don't remove the $LPP directive from the ouput (~Lpp_) Include files.
This creates problems to the compiler when the include file has the $LPP directive. Compiled alone is OK but as Include gives error at the first line.
I've added some code at line 672, to work around it but I'd like to have your advise on it.
Code: Select all
WriteStringN(outFileID, line$, format) ; Write line;
to
Code: Select all
If UCase(Left(line$, 4)) = "$LPP" ; remember $LPP must be first line
WriteStringN(outFileID, ";"+line$, format) ; comment $LPP directive
Else
WriteStringN(outFileID, line$, format) ; Write line;
EndIf
I'm I correct?
Regards,
Somic
Posted: Tue Aug 25, 2009 10:18 am
by Little John
Hi somic,
thanks for your interest in this tool, and for your kind words.
I'm very sorry that I obviously didn't see your message when you posted it. Today, I stumbled across it by chance.
In my system your preprocessor don't remove the $LPP directive from the ouput (~Lpp_) Include files.
This creates problems to the compiler when the include file has the $LPP directive.
The $LPP directive is supposed to be used only in the main source code file, not in any include file.
Regards, Little John
Posted: Thu Aug 27, 2009 12:37 am
by somic
I see.
But I've problems with my several and various include files and then, if you don't mind, I will keep the my copy of the code modified.
Thanks again,
Regards,
Somic
Posted: Mon Aug 31, 2009 12:57 pm
by Little John
Hi somic,
no problem. You are welcome!
Regards, Little John
Re: Little Purebasic Preprocessor - LPP
Posted: Wed Mar 03, 2010 8:03 pm
by blueznl
Duh, Little John, I never gave you credit for the multiline idea, as I used it in CodeCaddy

Re: Little Purebasic Preprocessor - LPP
Posted: Wed Mar 03, 2010 10:33 pm
by Little John
blueznl wrote:Duh, Little John, I never gave you credit for the multiline idea, as I used it in PureBasic

Hi blueznl,
no problem at all. However, I'm afraid I don't understand ( well, that's quite normal

).
Or do you mean "... used it in Code Caddy"?
Anyway, I stole the idea from QBasic, which I had used temporarily about 20 years ago.
Regards, Little John
Re: Little Purebasic Preprocessor - LPP
Posted: Wed Mar 03, 2010 10:49 pm
by blueznl
Yeah, I meant CodeCaddy... it's late and I'm tired, so starting to make mistakes...
Re: Little Purebasic Preprocessor - LPP
Posted: Sat May 22, 2010 5:51 pm
by RoySAC
It's a shame that such feature is not already build-into PB! The thing is that it does not have to be line separator at all. JavaScript allows multi-line commands without jumping through any hoops. The processor simply realizes that there is more to come and checks the next line... returning an error, if there isn't.
Thanks for the tool.
The PB folks should send you a present and put something like it into their interface by default (and without the need for "$LPP" at the beginning of the code

). Adding comments to procedure parameter is one place where it is hard to live without a multi-line command option, add also the fact that if you inherit structures from one object to another, PB still requires to provide the whole chain to be able to access the final element.
Code: Select all
Structure BLAH
field1.i
field2.f
EndStructure
Structure BLUB
ID
Blahs.BLAH
EndStructure
Structure BLUBBER
ID.i
Blubs.BLUB
Name.s
EndStructure
Global Dim Blubbers.BLUBBER(10)
Global Dim MoreBlubbers.BLUBBER(10)
;required
MoreBlubbers(a)\ID = Blubbers(a)\ID
;...
MoreBlubbers(a)\Blubs\ID = Blubbers(a)\Blubs\ID
;...
MoreBlubbers(a)\Blubs\Blahs\field1 = Blubbers(a)\Blubs\Blahs\field1
;...
;not possible
MoreBlubbers(a) = Blubbers(a)
;... not to mention
MyProc(Blubbers)
Procedure MyProc(WorkBlubbers) ;= like "ByRef" in VB to pass along whole object for processing
...
EndProcedure
All those things keep code shorter, but that's also unavailable, so touting that a multi-line feature is not needed for "clean" PB code is
hypocritical.
The commenting on individual Procedure paramters still remains though, regardless how "clean" your code is. Nothing beats "
THIS ; <== IS FOR THAT" when it comes to readability!
Thanks again for the Editor add-on!
Re: Little Purebasic Preprocessor - LPP
Posted: Sat May 22, 2010 9:56 pm
by Demivec
@RoySAC: PB includes some of the features you desire.
Code: Select all
;this is allowed since v4.40
MoreBlubbers(a) = Blubbers(a)
;Structured parameters can be handled in at least two ways:
; the first is for arrays
MyProc(Blubbers())
Procedure MyProc(Array WorkBlubbers.BLUBBER(1)) ;= like "ByRef" in VB to pass along whole object for processing
; ...
EndProcedure
; the second is for a single structured element
MyProc(a.BLUBBER) ; or also MyProc(Blubbers(1))
Procedure MyProc(*WorkBlubbers.BLUBBER) ;= like "ByRef" in VB to pass along whole object for processing
; ...
EndProcedure
I agree with the comments regarding multiline commands and using comments with them. I'm keeping hope alive.

Re: Little Purebasic Preprocessor - LPP
Posted: Sat Jan 01, 2011 5:17 pm
by Little John
Hi,
a happy new year for everybody!
I just posted the new version 0.61 (please see first post of this thread).
The main improvement is support for
#PB_Compiler_FilePath in Include statements.
Rgads, Lttle John