ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/IBUtils.pas
(Generate patch)

Comparing ibx/trunk/fbintf/IBUtils.pas (file contents):
Revision 117 by tony, Mon Jan 22 13:58:11 2018 UTC vs.
Revision 121 by tony, Mon Jan 22 13:58:23 2018 UTC

# Line 33 | Line 33
33  
34   unit IBUtils;
35   {$IFDEF MSWINDOWS}
36 < {$DEFINE WINDOWS}
36 > {$DEFINE WINDOWS}
37   {$ENDIF}
38  
39   {$IFDEF FPC}
40   {$Mode Delphi}
41   {$codepage UTF8}
42 + {$define HASREQEX}
43   {$ENDIF}
44  
45 +
46   interface
47  
48   uses Classes, SysUtils;
# Line 268 | Line 270 | function ExtractConnectString(const Crea
270  
271   implementation
272  
273 + {$IFDEF HASREQEX}
274   uses RegExpr;
275 + {$ENDIF}
276  
277   function Max(n1, n2: Integer): Integer;
278   begin
# Line 371 | Line 375 | end;
375  
376   {Extracts the Database Connect string from a Create Database Statement}
377  
378 + {$IFDEF HASREQEX}
379   function ExtractConnectString(const CreateSQL: AnsiString;
380    var ConnectString: AnsiString): boolean;
381   var RegexObj: TRegExpr;
# Line 388 | Line 393 | begin
393      RegexObj.Free;
394    end;
395   end;
396 + {$ELSE}
397 + {cruder version of above for Delphi. Older versions lack regular expression
398 + handling.}
399 + function ExtractConnectString(const CreateSQL: AnsiString;
400 +  var ConnectString: AnsiString): boolean;
401 + var i: integer;
402 + begin
403 +  Result := false;
404 +  i := Pos('''',CreateSQL);
405 +  if i > 0 then
406 +  begin
407 +    ConnectString := CreateSQL;
408 +    delete(ConnectString,1,i);
409 +    i := Pos('''',ConnectString);
410 +    if i > 0 then
411 +    begin
412 +      delete(ConnectString,i,Length(ConnectString)-i+1);
413 +      Result := true;
414 +    end;
415 +  end;
416 + end;
417 + {$ENDIF}
418  
419   {Format an SQL Identifier according to SQL Dialect with encapsulation if necessary}
420  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines