[futurebasic] [FB] [FB^3] [PG:PRO] Adding many to STR# resources.

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 1999 : Group Archive : Group : All Groups

From: "Michael Evans" <mikonic@...>
Date: Thu, 12 Aug 1999 11:43:37 -0400
I have found that FN's similar to "FN thisIsBad%" below do really bad stuff
to the stability of my applications when the value of mySrcStrCount% gets
very large.

On the other hand replacing "FN thisIsBad%" with "FN thisIsMuchBetter%"
seems to be bullet-proof up to mySrcStrCount% = 32000.

Anyone care to comment and might this be an issue for FB^3/PG:PRO^3?


CLEAR LOCAL
LOCAL FN thisIsBad%
  DIM myStr$, count%, mySrcStrCount%, InDeepDooDoo%

  InDeepDooDoo%  = _noErr
  mySrcStrCount% = FN countStr(_mySrcSTRlist)

  FN newStr(_myTargetSTRlist,"")
  FN delElement(1,_myTargetSTRlist)

  LONG IF myStrCount%
    FOR count% = 1 TO mySrcStrCount%
      myStr$ = STR#(_mySrcSTRlist, count%)
      FN apndElement(_myTargetSTRlist,myStr$)
    NEXT mySrcStrCount%
  XELSE
    InDeepDooDoo% = _zeroSrcStrCountErr
  END IF

END FN = InDeepDooDoo%

CLEAR LOCAL
LOCAL FN thisIsMuchBetter%
  DIM myStr$, count%, mySrcStrCount%, InDeepDooDoo%, resHndl&

  InDeepDooDoo% = _ noErr

  FN newStr(_myTargetSTRlist,"")
  FN delElement(1,_myTargetSTRlist)

  resHndl& = FN NEWHANDLE _clear(2)
  LONG IF resHndl&
    mySrcStrCount% = FN countStr(_mySrcSTRlist)

    LONG IF myStrCount%
      FOR count% = 1 TO mySrcStrCount%
        myStr$ = STR#(_mySrcSTRlist, count%)
        DEF APNDSTR(myStr$,resHndl&)
      NEXT mySrcStrCount%

      FN pGreplaceRes(resHndl&,_"STR#",_myTargetSTRlist,"")
      CALL UPDATERESFILE(gResRef)
    XELSE
      InDeepDooDoo% = _zeroSrcStrCountErr
    END IF
  XELSE
    InDeepDooDoo% = _zeroStrHandleErr
  END IF

END FN = InDeepDooDoo%




----------------------------------------------------------
Michael Evans
Manager of Software Development * Photo Systems, Inc.
3301 Wood Valley Road, NW * Atlanta, GA, 30327-1515
Voice: (404) 846-9386
Fax: (404) 240-0878 * Cell: (404) 229-3930
E-mail: evans@... * michael_evans@...
----------------------------------------------------------