
[Main]   rFunc
        2.1.3 RC

         (UDF) ,
,  ,        BLOB.  
, ..  .  InterBase 4.2, 5.x, 6.0
(Windows, Linux),   Firebird 1.x (Windows, Linux, FreeBSD)  Yaffil
1.x.      140   "" ( 
  UDF    ,    
  LongXXXX).    ++    
.

       readme.txt (readme.koi8) 
 .

[Image]           [Image]

 :

      
 f         DOUBLE PRECISION
 si        SMALLINT
 i         INTEGER

 d         DATE  IB4.2  IB5.x
           TIMESTAMP  IB6  
 c         CHAR(1)
 c"        CHAR(32)
 c*        VARCHAR(176)
 s         VARCHAR(255)
 S         VARCHAR(16383)
 s'        VARCHAR(8)
 s"        VARCHAR(31)
 s"'       VARCHAR(38)
           VARCHAR(8127)  IB4.2
 S**       VARCHAR(16383)  IB5.x 
           
 B         BLOB

                                  
                                        
                                  IB*     rFunc**
 
 Abs(f)                        f                   

 Ceil(f)                       f                   
                                                  
                                                   
 Floor(f)                      f  4-7     1.0     

 MaxNum(f1, f2)                f                    
 MinNum(f1, f2)                f                    
 Power(f1, f2)                 f                   f1   f2
                                                    f
 Round(f, i)                   f  4-7     1.1      i ,  
                                                  i>0  
                                                  ,   i<0 - 
                                                   Round, 
                                                   
 SoftRound(f, i)               f  4-7     1.5.0     0, 
                                                   
                                                  .
                                                    
                                                   NULL,  0. 
 Z(f)                          f  4-7     1.3.0     
                                                   , 
                                                  .

 IIf(i1, i2, i3)               i  4-7     1.3.0    i1=0,  i3, 
                                                    - i2

 DIf(i, f1, f2)                f  4-7     1.3.0    i=0,  f2, 
                                                    - f1

 DZero(f1, f2, f3)             f  4-7     1.3.0    f1  f2. 
                                                  f2=0,   f3.
                                                    
                                                        .
                                                    
                                                          
                                                  + - * /
                                                  Sin, Cos, tg, ctg,
                                                  ArCos, ArcSin, ArcTg,
                                                  sh, ch, th,
                                                  exp, lh, lg, sqrt, sqr,
                                                  abs(x1)
                                                  sgn(x1) -   x1
                                                  log(x1,x2) -  x1
                                                    x2
                                                  power(x1,x2) -
 CalcExpr(S1, S2)                                  x1  
                                                  x2
 :                                        if(expr, x1, x2) - 
 CalcExpr('Sin(                f  4-7     1.3.0   expr=0,  x2,  x1
 Pi*:p11/3)*:P2',                                 Min(x1, ...) - 
 'P11=2;P2=10')                                    
                                                  Max(x1, ...) - 
                                                   
                                                  Sum(x1, ...) -
                                                   
                                                  Avg(x1, ...) - 
                                                  
                                                  Pi -  Pi.

                                                        
                                                     -
                                                    
                                                  ,  
                                                    
                                                   (. ).
                                                    
                                                   .
 ExprIsValid(S1, S2)           i  4-7     1.3.0    0,  
                                                  ,  - 
                                                  .
 Div(i1, i2)                   i  4-7     1.5.0     i1  i2

 Mod(i1, i2)                   i  4-7     1.5.0      i1 
                                                  i2

 InitRandom(i)                 i  4-7     2.0.0    
                                                   .

 GetRandom(i)                  i  4-7     2.0.0     
                                                   0..i.

 IEqual(i1, i2) [Image]        i  4-7     2.1.1      (1
                                                   "")

 Sign(f) [Image]               si 4-7     2.1.1     (-1  f<0,
                                                  0  f=0, 1  f>0).
 Sqrt(f) [Image]               f  4-7     2.1.3     

 Exp(f) [Image]                f  4-7     2.1.3    e 
                                                    f

 Log(f1, f2) [Image]           f  4-7     2.1.3     f1 
                                                   f2

 Log10(f) [Image]              f  4-7     2.1.3    
                                                  
 Ln(f) [Image]                 f  4-7     2.1.3    

 E [Image]                     f  4-7     2.1.3    E
                                                  (2.7182818284590451)
  [Image]
 ACos(f)                       f                  
 ASin(f)                       f                  
 ATan(f)                       f                  
 ATan2(f1, f2)                 f                   f1/f2
 Cos(f)                        f                  

 CosH(f)                       f  4-7     2.1.3    
 Sin(f)                        f                  
 SinH(f)                       f                   
 Tan(f)                        f                  
 TanH(f)                       f                   

 Pi                            f                   Pi
                                                  (3.1415926535897931)
 
 Chr(si)                       c  4-7     1.1       
 Ord(c)                        si 4-7     1.1      
 StrReplace(s1, s2, s3)        s          1.2.1
 LongStrReplace(S1, S**2,         4-7                s1
                               S          1.2.0    s2  s3
 S**3)

 StrStuff(s1, i1, i2, s2)      s          1.0       s1  i2
                                  4-7             ,   i1,
                                                      
 LongStrStuff(S1, i1, i2, S2)  S          1.2.0   s2
 LTrim(s)                      s          1.0
                                  4-7               
 LongLTrim(S)                  S          1.2.1
 RTrim(s)                      s          1.0
                                  4-7               
 LongRTrim(S)                  S          1.2.1
 StrLen(S)                     i  4-7     1.0      
                                                    s1 
 StrPos(s1, S2)                i  4-7     1.0      s2.  
                                                  ,  0.
 StrRepeat(s, i)               s          1.0
                                  4-7               s i 
 LongStrRepeat(S, i)           S          1.2.1
                                                    s,
                                                     i1 
 SubStr(s, i1, i2)             s          1.0       i2.
                                                  i1 < 0 - 
                                  4-7               
                                                  ,
 LongSubStr(S, i1, i2)         S          1.2.1   i2 < 0 - 
                                                     
                                                  .
 Trim(s)                       s          1.0       
                                  4-7
 LongTrim(S)                   S          1.2.1     
 CIf(i, s1, s2)                s                   i=0,  s2, 
                                  4-7     1.3.0
 LongCIf(i, S1, S2)            S                    - s1

 StrCount(s1, S2)              i  4-7     1.3.0     s1
                                                   S2
                                                     
                                                  S,  
 WordCount(S, s", si)          i  4-7     1.3.0     s". 
                                                  si<>0,  
                                                   
                                                   .
                                                  i-    S,
 WordNum(S, i, s", si)         s                    

                                  4-7     1.3.0    s".  si<>0,
                                                   
 LongWordNum(S, i, s", si)     S                   
                                                   .
 RLower(s)                     s          1.4.0      
                                  4-7
 LongRLower(S)                 S          1.5.0   (WIN1251)
 RUpper(s)                     s          1.4.0     
                                  4-7
 LongRUpper(S)                 S          1.5.0    (WIN1251)

 PadLeft(s, i, c)              s                    s 
                                  4-7     2.0.0    i  c
 LongPadLeft(S, i, c)          S                  .
 PadRight(s, i, c)             s                    s 
                                  4-7     2.0.0    i  c
 LongPadRight(S, i, c)         S                  .
 RLatin(s)                     s                    
                                  4-7     2.0.0   win1251  "" 
 LongRLatin(S)                 S                  .
 RTranslit(s)                  s                   
                                  4-7     2.0.0
 LongRTranslit(S)              S                  win1251  .
                                                    (si<0 -
 StrCmp(S1, S2) [Image]        si 4-7     2.1.1    , si=0 -
                                                  , si>0 - 
                                                  )
 C(s) [Image]                  s                    ,
                                  4-7     2.1.1     
 LongC(S) [Image]              S                   Null.

 CEqual(S1, S2) [Image]        i  4-7     2.1.1     (1
                                                   )

 RepeatTrim(s1, s2) [Image]    s                     s2
                                                    s1.
 LongRepeatTrim(S1, S2)           4-7     2.1.1   :
 [Image]                       S                  RepeatTrim('1223', '2')
                                                  = '123'

 ConvertSymbols(s1, s2, s3)                          
 [Image]                          4-5     1.0     s2   s3  
                               i                  s1.
                                                  :
 LongConvertSymbols(S1, s2,       4-7     2.1.1   ConvertSymbols('1+2=3',
 s3) [Image]                                      '123', 'abc') = 'a+b=c'
  & 

 DayPerMonth(i1, i2)           i  4-7     1.0        i1 
                                                  i2 
                                                   
 Dow(d)                        i  4-7     1.0     (1-, ..,
                                                  7-)

 ExtractDate(d)                           1.2.3    + 
                                                   
                               d  4-7
 ExtractTime(d)                           2.0.0    + 
                                                   
 Day(d)                           4-5     1.0
                               i                  
 ExtractDay(d) [Image]            4-7     2.1.1
 Month(d)                         4-5     1.0
                               i                  
 ExtractMonth(d) [Image]          4-7     2.1.1
 Year(d)                          4-5     1.0
                               i                  
 ExtractYear(d) [Image]           4-7     2.1.1
 Hour(d)                          4-5     1.5.2
                               i                  
 ExtractHour(d) [Image]           4-7     2.1.1
 Minute(d)                        4-5     1.5.2
                               i                  
 ExtractMinute(d) [Image]         4-7     2.1.1
 Second(d)                        4-5     1.5.2
                               i                  
 ExtractSecond(d) [Image]         4-7     2.1.1
 ExtractMillisecond(d) [Image] i  6-7     2.1.3   

 WeekDay(d)                       4-5     2.0.0     . (0 -
                               i                  , 1 -
                                                  , ..., 6 -
 ExtractWeekDay(d) [Image]        4-7     2.1.1   )
 YearDay(d)                       4-5     2.0.0
                               i                   
 ExtractYearDay(d) [Image]        4-7     2.1.1
 Quarter(d)                    i  4-7     2.0.0    
 FirstDayMonth(d)              d  4-7     2.0.0     
 LastDayMonth(d)               d  4-7     2.0.0     

 IsLeapYear(i)                 i  4-7     2.0.0   1 -  , 0 -
                                                  

 DaysBetween(d1, d2)           i  4-7     2.0.0     
                                                  

 DtIf(i, d1, d2)               d  4-7     2.0.0    i=0,  d2, 
                                                    - d1
                                                     i1
 IncDate(d, i1, i2, i3)        d  4-7     2.0.1   , i2 , i3
                                                  .
                                                     i1
 IncDateTime(d, i1, i2, i3,                       , i2 , i3
 i4, i5, i6) [Image]           d  4-7     2.1.1   , i4 , i5 ,
                                                  i6 .
 MaxDate(d1, d2) [Image]       d  4-7     2.1.1     
 MinDate(d1, d2) [Image]       d  4-7     2.1.1     

 DtEqual(d1, d2) [Image]       i  4-7     2.1.1     (1
                                                   )
  
                                                    d 
                                                       s.
                                                    
                                                  ( -
                                                         strftime):
                                                  %% -  %,
                                                  %c -   ,
                                                  %x - ,
                                                  %d -  
                                                  (01-31),
                                                  %j -  
                                                  (000-366),
                                                  %w -   (0-6),
                                                  0 - ,
 DateToStr(d, s)                                  %U -    
                                                  (00-53),  -
 :                                          ,
 DateToStr('10.02.99','%d.%m.                     %W -    
 %y') = '10.02.99'             s  4-7     1.0     (00-53),  -
 DateToStr('10.02.04                                ,
 08:23','%d %B %Y, %X') =                         %a -  
 '10 February 2004, 08:23:00'                      ,
                                                  % -   
                                                  ,
                                                  %m -  (01-12),
                                                  %b -  
                                                  ,
                                                  %B -  
                                                  ,
                                                  %y -  (00-99),    %Y
                                                  -  ,
                                                  %X - ,
                                                  %H -  (00-23),   %I -
                                                   (01-12),
                                                  %M -  (00-59),
                                                  %p - AM  PM,
                                                  %S -  (00-59).

 EncodeDate(i1, i2, i3)        d  4-7     1.0        i1.i2.i3
                                                  = ..

 EncodeDateTime(i1, i2, i3,                           
 i4, i5, i6)                   d  4-7     1.5.2   i1.i2.i3 i4:i5:i6 =
                                                  .. ::

 DoubleToDate(f) [Image]       d  4-7     2.1.2     
                                                  .

 DoubleToTime(f) [Image]       d  4-7     2.1.2     
                                                  .

 DateToDouble(d) [Image]       f  4-7     2.1.1     
                                                  .

 TimeToDouble(d) [Image]       f  4-7     2.1.1     
                                                  .
                                                    f 
                                                       s.
                                                    
                                                      (  c-
                                                         sprintf):
                                                     % [flags] [width]
                                                     [.prec] type_char
                                                  flags:
                                                    -    
                                                    +     
                                                          
                                                   
                                                        
                                                    #   .
                                                        :
                                                        0x (0X) 
                                                          x,X
                                                         
                                                          e,E,f
                                                  width:
                                                    n     n
                                                        ,
                                                        
                                                        
                                                    0n    n
                                                        ,
                                                         
 FloatToStr(f, s) [Image]                         prec:
                                                  () 1  
 :                                              d,i,o,u,x,X
 FloatToStr(13.5, '%7.3e') =                            6   e,E,f
 '1.350e+01'                                              
 FloatToStr(13.5, '%+7.3f') =                            g,G
 ' +13.500'                                         .0  for d,i,o,u,x
 FloatToStr(13.5345, '%.5g') = s  4-7     2.1.1         types, precision
 '13.534'                                               set to default
 FloatToStr(13.5345, '%.5f') =                          for e,E,f types,
 '13.53450'                                             no decimal point
 FloatToStr(13, '%05X') =                           .n   
 '0000D'                                                d,i,o,u,x - 
 FloatToStr(13, '%#04x') =                               n 
 '0x0d'                                                   e,E,f -
                                                        n  
                                                         
                                                         g,G - 
                                                          n
                                                         
                                                  type_char:
                                                   d,i   
                                                         
                                                    o    
                                                         
                                                    u    
                                                         
                                                   x,X  
                                                        
                                                         
                                                    f      
                                                         [-]dddd.dddd
                                                    e      
                                                         [-]d.dddd
                                                         e[+/-]ddd
                                                    g      
                                                         e  f,
                                                         
                                                          
                                                   E,G   ,   e,g,
                                                          E  
                                                         
                                                   
 IntToStr(i, s) [Image]        s  4-7     2.1.1    i   
                                                   s (.
                                                  FloatToStr)
                                                    (
 NumInWords(i, c) [Image]                         WIN1251).
 :                                        c - 
 NumInWords(22, 'F') =         s  4-7     2.1.3   :
 ' '                                   N - , M -
                                                  , F - , P
                                                  - .
 BLOB
 B_Line(B, i)                  s
                                                  i-  B
 B_LongLine(B, i)              S
 B_Line_Count(B)               i                   

 B_Max_Segment(B)              i                   
                                                  

 B_Number_Segments(B)          i  4-7     2.0.0    
                                                    
 B_Put_Segment(S)              B                  blob- ( . 
                                                  rtest.sql)
 B_SubStr(B, i1, i2)           s
                                                   SubStr
 B_LongSubStr(B, i1, i2)       S
 B_Total_Length(B)             i                     B

 B_StrCmp(B1, B2) [Image]      si 4-7     2.1.2     BLOB.
                                                   StrCmp

 B_StrPos(S, B) [Image]        si 4-7     2.1.2      BLOB.
                                                   StrPos

 B_TextPos(S, B) [Image]       si 4-7     2.1.2    B_StrPos, 
                                                  
 
 BitAnd(i1, i2)                i                  i1 and i2
 BitNot(i)                     i                  not(i)
 BitOr(i1, i2)                 i                  i1 or i2
 BitXor(i1, i2)                i                  i1 xor i2
                                  4-7     2.0.0
 GetBit(i1, i2)                i                  i2-   i1
                                                   i2-  
 SetBit(i1, i2, i3)            i                  i1  i3. i3 
                                                    0 
                                                  1.
 API
                                                    
                                                   .
                                                  API InterBase. 
 Add_User(i, s1, s"2, s'3,                        () 
 s"4, s"5, s"6, s"7, s"8, s'9)                      s''2  
                                                  s1  UNIX- s''4.
 :                                         
 Add_User(1, 'ibserver',       i                    i (1-TCPIP,
 'uname', 'password', '',                         2-NetBEUI, 3-SPX,
 'john', 'jr', 'Doe',             5-7     1.3.0   4-)
 'sysdba', 'masterke')                             s''8 
                                                   s'9. :
                                                  s'3 - , s''5 -
                                                  , s''6 - ,
                                                  s''7 - .
 Modify_User(i, s1, s"2, s'3,                      
 s"4, s"5, s"6, s"7, s"8, s'9) i                  
                                                  (0-).
                                                   .
                                                  API IB Database. 
                                                    
                                                  s''2   s1.
 Delete_User(i, s1, s"2, s"8,                      
 s'9)                          i  5-7     1.3.0     i (1-TCPIP,
                                                  2-NetBEUI, 3-SPX,
                                                  4-)
                                                   s''8 
                                                   s'9.
                                                    
                                                   . 
                                  5-7             
 MsgBox(S1, s2, i)             i    1.3.0    
                                  Windows          . API
                                                  Windows.   
                                                   s2  
                                                  S1.
 
 LibVersion [Image]            s  4-7     2.1.1     rFunc

 LibName [Image]               s  4-7     2.1.1     (
                                                  "rfunc")

 EAN13cs(s) [Image]            si 4-7     2.1.1    
                                                   EAN13.

 MD5Sum(S) [Image]             c" 4-7     2.1.3     
                                                  S   MD5
                                                   
                                                    MD5.
                                                   :
 MD5Init [Image]               c*                 -  
                                                  context CHAR(176) 
                                                   
                                                   ;
                                                  -  
                                                  md5 CHAR(32) 
                                                   ;
                                                  -  context =
 MD5Update(c*, S, i) [Image]   c* 4-7     2.1.3   md5Init();
                                                  -   (  
                                                   ) 
                                                  context =
                                                  md5Update(context, S,
                                                  SLen), 
                                                  context -  ,
                                                  S -  
 MD5Final(c*) [Image]          c"                 ,
                                                  SLen - 
                                                   ;
                                                  -  md5 =
                                                  md5Final(context);

 CreateGUID [Image]            s"'4-7     2.1.3   GUID  
                                                  
  [Image]
   - .     
   ( readme.txt).    
  .       
     .
                                                      s.
                                                  i -  
 FCreate(s, i)                 i                  ( FS_xxx).
                                                   
                                                    
                                                    .
                                                     
                                                  s.  
                                                   i1. i2 -
 FOpen(s, i1, i2)              i                    
                                                  (i1=FO_CREAT).
                                                   
                                                    
                                                    .
 FRead(i1, i2)                                     i2   
                               s          2.1.2     i1.
 LongFRead(i1, i2)
                                  4-7
                                                    
                                                   S   
 FWrite(i, S)                  i                   i.
                                                   
                                                   .
                                                   
                                                   i1  
 FSeek(i1, i2, i3)             i                  , 
                                                    i2  
                                                    
                                                  i3.
                                                    
 FClose(i)                     i                   i.
                                                   0.
 FRemove(s)                    i          2.1.3       s.
 FSize(s)                      i          2.1.3    
                                                    
                                                   .
 -                               
  i1  FOpen:                      .
 FO_RDONLY                                           
 FO_WRONLY                                        .
 FO_RDWR                                  2.1.2      , 
 FO_CREAT                                          .
 FO_TRUNC                      i  4-7               , 
 FO_EXCL                                          .
                                                   .
                                                    FO_CREAT.
                                                    
 FO_APPEND                                2.1.3     
                                                    
                                                    .
 - 
  i3  FSeek:
 FSEEK_SET                     i  4-7     2.1.2     .
 FSEEK_CUR                                         .
 FSEEK_END                                         .
 - 
  i3  FOpen 
 i2 FCreate:
 FS_IREAD                      i  4-7     2.1.3     
 FS_IWRITE                                          
 FS_IEXEC                                           

* - Firebird 1.x  Yaffil 1.x  Interbase 6
** -   

[Image]  [Image]

  ,   rFunc UDF Library,   
rFunc@mail.ru   .

[Image]
Copyright  2003 Polaris Software
