[Harbour] HBMK2 - Few Changes

Viktor Szakáts harbour.01 at syenar.hu
Sat May 2 15:23:47 EDT 2009


Than we have the embedded comment problem, plus detecting /* / */ in already
commented lines (#). All too many problems with
little gain IMO. Not to mention /* appearing as regular and valid file
items:
---
src/*.prg
---

Brgds,
Viktor

On Sat, May 2, 2009 at 9:15 PM, Pritpal Bedi <bedipritpal at hotmail.com>wrote:

>
> Hi
>
> Here is what I placed at the end of hbmk.prg to strip commented block:
>
> STATIC FUNCTION StripCommnets( cFile )
>   LOCAL n, n1
>
>   DO WHILE .T.
>      IF ( n := at( '/*', cFile ) ) == 0
>         EXIT
>      ENDIF
>      IF ( n1 := at( '*/', cFile ) ) == 0
>         EXIT
>      ENDIF
>
>      cFile := SubStr( cFile, 1, n-1 ) + SubStr( cFile, n1+2 )
>   ENDDO
>
>   RETURN cFile
>
> And then in:
>
> STATIC PROCEDURE HBM_Load( aParams, cFileName, /* @ */ nEmbedLevel )
>   LOCAL cFile
>   LOCAL cLine
>   LOCAL cParam
>
>   IF hb_FileExists( cFileName )
>
>      cFile := MemoRead( cFileName ) /* NOTE: Intentionally using MemoRead()
> which handles EOF char. */
>       cFile := StripCommnets( cFile )
> ...
>
> Regards
> Pritpal Bedi
>
> --
> View this message in context:
> http://www.nabble.com/HBMK2---Few-Changes-tp23348709p23349387.html
> Sent from the Harbour - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Harbour mailing list
> Harbour at harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.harbour-project.org/pipermail/harbour/attachments/20090502/54476554/attachment.html


More information about the Harbour mailing list