From 095e05a9a1853d52ea4946654814ea75ef71f540 Mon Sep 17 00:00:00 2001 From: Brian Hays Date: Fri, 25 Jan 2002 08:29:46 +0000 Subject: [PATCH] 2002-01-25 00:40 UTC-0800 Brian Hays --- harbour/ChangeLog | 22 ++++++++++++++++++---- harbour/contrib/rdd_ads/adsfunc.c | 21 ++++++++++++++++++--- harbour/source/rtl/persist.prg | 15 ++++++++++++--- 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8917fb2a78..9cef6070c6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,24 +8,38 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ * tests/testpers.prg + - Removed the use of cName, it hasn't been supported for a long time + and it was stopping this test from working. + +2002-01-25 14:35 UTC+0100 Antonio Linares + * include/hbexprb.c + * include/hbexprc.c + * proper generation (placement) of HB_P_SEND opcode + + + * include/hbvm.h + - hb_vmMessage() prototype removed + + * source/vm/classes.c + - hb_vmMessage() use removed * source/vm/hvm.c * HB_P_SEND now invokes hb_vmPushSymbol() - + - function hb_vmMessage() completely removed 2002-01-25 00:40 UTC-0800 Brian Hays - * HBProfileLowLevel:gatherOPCodes() wasn't making a call to + * source/rtl/persist.prg * added arg to StrTran in LoadFromText() to limit conversion of "=" to ":=" to only the first instance, so data containing a "=" doesn't get changed * fixed ValToText() so data containing embedded quotes doesn't - + blow up (because it gets wrapped in quotes to save it). Tests if the string contains a " and uses single quotes instead, or use [] if it contains both. Future enhancement should cover if contains all 3.... * contrib/rdd_ads/adsfunc.c - + * Added wrapper for AdsDisconnect( ) (from Charles Kwon) 2002-01-24 17:53 UTC+0000 Dave Pearson * include/hbpcode.h diff --git a/harbour/contrib/rdd_ads/adsfunc.c b/harbour/contrib/rdd_ads/adsfunc.c index a095e4009c..5295000bd4 100644 --- a/harbour/contrib/rdd_ads/adsfunc.c +++ b/harbour/contrib/rdd_ads/adsfunc.c @@ -858,14 +858,30 @@ HB_FUNC( ADSCONNECT ) { ulRetVal = AdsConnect ( (UNSIGNED8*) hb_parc( 1 ), &adsConnectHandle ); if ( ulRetVal == AE_SUCCESS ) - hb_retl( 1 ); + hb_retl( 1 ); else - hb_retl( 0 ); + hb_retl( 0 ); } else hb_retl( 0 ); } +HB_FUNC( ADSDISCONNECT ) +{ + UNSIGNED32 ulRetVal; + + ulRetVal = AdsDisconnect( hb_parnl(1) ); + + if ( ulRetVal == AE_SUCCESS ) + { + hb_retl( 1 ); + } + else + { + hb_retl( 0 ); + } +} + HB_FUNC( ADSCREATESQLSTATEMENT ) { UNSIGNED32 ulRetVal; @@ -1184,4 +1200,3 @@ HB_FUNC( ADSGETCONNECTIONHANDLE ) hb_retni( adsConnectHandle ); } - diff --git a/harbour/source/rtl/persist.prg b/harbour/source/rtl/persist.prg index bc58509cb2..368dbfcf9d 100644 --- a/harbour/source/rtl/persist.prg +++ b/harbour/source/rtl/persist.prg @@ -102,7 +102,7 @@ METHOD LoadFromText( cObjectText ) CLASS HBPersistent case Left( cToken := LTrim( __StrToken( cLine, 1, "=" ) ), 2 ) == "::" M->oSelf := Self cLine := StrTran( cLine, "::", "oSelf:" ) - cLine := StrTran( cLine, "=", ":=" ) + cLine := StrTran( cLine, "=", ":=", , 1 ) &( cLine ) endcase @@ -210,11 +210,20 @@ return cArray static function ValToText( uValue ) local cType := ValType( uValue ) - local cText + local cText, cQuote := '"' do case case cType == "C" - cText := '"' + uValue + '"' + if cQuote $ uValue + cQuote := "'" + if cQuote $ uValue + cText := "["+ uValue + "]" + else + cText := cQuote + uValue + cQuote + endif + else + cText := cQuote + uValue + cQuote + endif case cType == "N" cText := AllTrim( Str( uValue ) )