Hi Pritpal,

If you make such output parsing, make sure to always 
use '-lang=en' option when calling hbmk2, otherwise 
it won't work in localized (Portuguese and Hungarian 
currently) environments.

I've added -width= option, so if you now use it also 
when calling hbmk2 ('-width=999' f.e.), it won't 
split long lines, so you can simply look for LF char 
to find the end of the output filename, instead of 
looking for .exe. .exe is not good, because it's 
platform dependent.

'-out=' option parsing cannot reliably work, so I'd 
suggest to delete it:

---
  IF ::lLaunch
     cTmp := ::oOutputResult:oWidget:toPlainText()
     cExe := ""
     IF empty( cExe )
        cTkn := "hbmk2: Linking... "
        IF ( n := at( cTkn, cTmp ) ) > 0
           n1   := hb_at( Chr( 10 ), cTmp, n + len( cTkn ) )
           cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + 1 )
        ENDIF
     ENDIF
     IF empty( cExe )
        cTkn := "hbmk2: Target up to date: "
        IF ( n := at( cTkn, cTmp ) ) > 0
           n1   := hb_at( Chr( 10 ), cTmp, n + len( cTkn ) )
           cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + 1 )
        ENDIF
     ENDIF
     /* This won't work reliably, first because .exe is not a mandatory 
        part (in fact it should never be used if .hbp file is meant to be 
        portable), .exe is not portable, and the line may contain various 
        macros and filters and there may be multiple -opt options with 
        different filters. */
     #if 0
     IF empty( cExe )
        cTkn := "-out:"
        IF ( n := at( cTkn, cTmp ) ) > 0
           n1   := hb_at( ".exe", cTmp, n + len( cTkn ) )
           cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + 4 )
        ENDIF
     ENDIF
     #endif
  ENDIF
---

Brgds,
Viktor

On 2010 Mar 14, at 22:08, Pritpal Bedi wrote:

> 
> Hello Viktor
> 
> Currenly I employ the method below to pull executable path
> from compile/link process:
> 
>   IF ::lLaunch
>      cTmp := ::oOutputResult:oWidget:toPlainText()
>      cExe := ""
>      IF empty( cExe )
>         cTkn := "hbmk2: Linking... "
>         IF ( n := at( cTkn, cTmp ) ) > 0
>            n1   := hb_at( ".exe", cTmp, n + len( cTkn ) )
>            cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + 4
> )
>         ENDIF
>      ENDIF
>      IF empty( cExe )
>         cTkn := "hbmk2: Target up to date: "
>         IF ( n := at( cTkn, cTmp ) ) > 0
>            n1   := hb_at( ".exe", cTmp, n + len( cTkn ) )
>            cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + 4
> )
>         ENDIF
>      ENDIF
>      IF empty( cExe )
>         cTkn := "-out:"
>         IF ( n := at( cTkn, cTmp ) ) > 0
>            n1   := hb_at( ".exe", cTmp, n + len( cTkn ) )
>            cExe := substr( cTmp, n + len( cTkn ), n1 - n - len( cTkn ) + 4
> )
>         ENDIF
>      ENDIF
> 
> Can you provide a uniform token, say,
> hbmk2: target path...  [C:\dev_projects\harbour\vouch\vouch.exe]
> 
> 
> 
> -----
>                 enjoy hbIDEing...
>                    Pritpal Bedi 
> _a_student_of_software_analysis_&_design_
> -- 
> View this message in context: 
> http://n2.nabble.com/hbMK2-Uniform-token-to-announce-output-file-tp4733528p4733528.html
> Sent from the harbour-devel mailing list archive at Nabble.com.
> _______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to