archive-com.com » COM » E » EFG2.COM

Total: 878

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

  • the inefficiency The true answer is to go get the free HyperString from http efd home mindspring com tools htm source is 39 Otherwise I d like to correct Roman s blind infatuation with pointers and so slow too Function stripChar s string c char string Returns s minus all occurrences of c Var js integer current index into s js0 integer index of first uncopied char in s jr

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0421b.txt (2016-02-14)
    Open archived version from archive



  • popped up repeatedly on this list and with increasing use of linux and unix it would be nice to have the fastest solution well discussed and readily available I m not sure this is the fastest solution but here goes procedure TextToDOS szSourceFile szDestFile string var inStream outStream TFileStream szBuf string iRead integer begin inStream TFileStream Create szSourceFile fmOpenRead outStream TFileStream Create szDestFile fmcreate iRead 1 try while iRead 0

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0504.txt (2016-02-14)
    Open archived version from archive


  • LeftMark CHAR CONST RightMark CHAR CONST Escape CHAR CONST SeparatorBetweenTokens TTokenSeparator With default Tokens instance can access a token as Tokens i which is equivalent to Tokens Token i PROPERTY Token index INTEGER STRING READ GetToken DEFAULT PROPERTY OriginalString STRING READ FOriginalString PROPERTY Count WORD READ FCount END IMPLEMENTATION CONST NULL 00 TYPE TFiniteStates fsSkipSeparatorsState fsAcceptSingleWordTokenState fsAcceptMultiWordTokenState fsEscapeState CONSTRUCTOR TTokens Create CONST OriginalString STRING CONST separators STRING CONST LeftMark CHAR CONST RightMark CHAR CONST Escape CHAR CONST SeparatorBetweenTokens TTokenSeparator VAR c CHAR i WORD IgnoreNextSeparator BOOLEAN state TFiniteStates BEGIN INHERITED CREATE FOriginalString OriginalString FTokenString FCount 0 The following flag is somewhat of a kludge to allow a single separator to follow the closing RightMark of a Multiword Token when SingleSeparatorBetweenTokens is TRUE IgnoreNextSeparator FALSE Initial state of finite machine that recognizes tokens state fsSkipSeparatorsState FOR i 1 TO LENGTH FOriginalString DO BEGIN c FOriginalString i CASE state OF fsSkipSeparatorsState Do nothing if character is separator IF POS c Separators 0 THEN BEGIN For cases like multiple comma delimited fields treat each separator as end of a token e g x y woud be 4 tokens IF SeparatorBetweenTokens tsSingleSeparatorBetweenTokens THEN BEGIN IF IgnoreNextSeparator THEN IgnoreNextSeparator FALSE ELSE BEGIN INC FCount FTokenString FTokenString NULL END END END ELSE BEGIN IF c LeftMark THEN BEGIN state fsAcceptMultiWordTokenState INC FCount END ELSE BEGIN state fsAcceptSingleWordTokenState INC FCount FTokenString FTokenString c END END fsAcceptSingleWordTokenState IF POS c Separators 0 THEN FTokenString FTokenString c not a separator ELSE BEGIN separator FTokenString FTokenString NULL state fsSkipSeparatorsState END fsAcceptMultiWordTokenState IF c RightMark THEN BEGIN FTokenString FTokenString NULL state fsSkipSeparatorsState IgnoreNextSeparator TRUE END ELSE BEGIN IF c Escape THEN state fsEscapeState ELSE FTokenString FTokenString c END fsEscapeState BEGIN FTokenString FTokenString c state fsAcceptMultiWordTokenState END END END END Constructor Index should be 0 FCount 1 FUNCTION TTokens GetToken index INTEGER

    Original URL path: http://www.efg2.com/Lab/Library/Delphi/Strings/Tokens.pas.TXT (2016-02-14)
    Open archived version from archive


  • words on a Memo Field Is there a property for that or a thirdparty component that include it Thanks Alejandro I would try something like this I believe that you can do a memo field as string to get the entire text otherwise you may need to figure out how to do this or modify my function function CountWords s string integer untested var InWord boolean i integer begin InWord

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/2000/0120b.txt (2016-02-14)
    Open archived version from archive


  • Text String WordSeparators TWordSeparators EnumFunc TEnumWordsCallBack Cardinal var i Len Mark Integer CallBackResult Boolean AWord String begin init variables i 1 Len Length Text Mark 0 CallBackResult true Result 0 process word until CallBack function returns false or end of text is reached while CallBackResult and i 0 then begin call CallBackFunction AWord Copy Text Mark i Mark Inc Result CallBackResult EnumFunc AWord Mark Mark 0 end end else begin

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/2000/0121a.txt (2016-02-14)
    Open archived version from archive


  • INTEGER VAR i INTEGER state 0 2 state of finite state machine w INTEGER BEGIN w 0 state 0 FOR i 1 TO LENGTH s DO BEGIN CASE state OF 0 IF s i THEN state 1 END END IF

    Original URL path: http://www.efg2.com/Lab/Library/Delphi/Strings/Words.pas.TXT (2016-02-14)
    Open archived version from archive


  • app in Delphi with the following code BCB extern C declspec dllexport stdcall void test char void stdcall test char InputBuffer Delphi procedure test InputBuffer String stdcall external MyDLL dll No you do this wrong sorry A Delphi String AnsiString is NOT equivalent to a C char It happens to work if the string is only read by the C side since AnsiStrings are always zero terminated but the 0 at end does not define the length there is a length dword at negative offsets to the string pointer and a AnsiString variable is a pointer that points at the first character but will break if the routine tries to write to the character buffer since that not only circumvents the reference counting mechanism but also has the potential to write beyond the end of buffer Build your function like the API does for functions like GetWindowsDirectory you pass them a buffer pointer PChar and the size of the buffer so the routine can guard against overwriting procedure Test inputbuffer PChar buffersize Integer stdcall external You use this like you would an API function from delphi Var S String Begin SetLength S 512 Test PChar S Length S SetLength S

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0624e.txt (2016-02-14)
    Open archived version from archive


  • rumor The problem is that the reference count was not protected in D4 and earlier Suppose a global string is accessed in two threads For example two threads call Proc simultaneously var S string This is a string procedure Proc var X string begin X S end Ideally the string s reference count is incremented in thread A then incremented in thread B then decremented in A and decremented in

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/1119c.txt (2016-02-14)
    Open archived version from archive



  •