IsBinaryData

IsBinaryData

Postby Otto » Mon Nov 14, 2022 12:29 am

Dear Mr. Rao,
it seems to me that
IsBinaryData() is not working well.

I also see that it is substituted in xBrowse with c function.

What IsBinaryData() should we use in mod Harbour?

Best regards,
Otto

Code: Select all  Expand view
function main
    local aTage := {}
    local aVerfuegbarkeit := {}
    local I := 0
    local aHead := { "COL", "COL","COL","COL","COL"}
   
    AADD( aTage, "Kategorie")
    FOR nIdx := 1 to 3
        AADD( aTage, str( nIdx ) )
    NEXT  
   
    ? MH_ArrayToHTML( aTage, aHead, .t. )

   
    AADD( aVerfuegbarkeit, aTage )
    AADD( aVerfuegbarkeit, aTage )
   
    AADD( aVerfuegbarkeit, aTage )
    ? len( aVerfuegbarkeit )
   
    FOR I := 1 to len(aVerfuegbarkeit)
        ? aVerfuegbarkeit[I,1]
    NEXT
   
    ? MH_ArrayToHTML( aVerfuegbarkeit, aHead  , .t. )


return
 
#include    "c:\www\htdocs\hrbSamples\MHFNGNR1.PRG" )




Code: Select all  Expand view

static function IsBinaryData( cData, nLen )

   local c, n, lBinary  := .f.
   
   ? "============================IsBinaryData"
   ? "VALUE : " + cData

   if nLen == nil
      nLen  := Min( 50, Len( cData ) )
   endif
   for n := 1 to nLen
      c  := SubStr( cData, n, 1 )
? c

      ? "for/next" + c
      if ( c < ' ' .and. !( c $ Chr( 9 ) + Chr( 10 ) + Chr( 12 ) + Chr( 13 ) + Chr(26) ) )
? str( ASC(c) )
         ? c + "exit"
         
         lBinary  := .t.
         exit
      endif
   next

   ? "============================IsBinaryData ende "      
 
return lBinary

//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: IsBinaryData

Postby Antonio Linares » Mon Nov 14, 2022 8:20 am

Dear Otto,

good morning,

You could use this one for mod_harbour:
Code: Select all  Expand view
function IsBinaryData( cData )

   local char

   for each char in cData
      if char < ' ' .and. ! char $ Chr( 9 ) + Chr( 10 ) + Chr( 12 ) + Chr( 13 ) + Chr( 26 )
         return .T.
      endif
   next

return .F.
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: IsBinaryData

Postby Otto » Mon Nov 14, 2022 10:26 am

Dear Antonio,
thank you. Al working fine now.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests