meta data for this page
  •  

F_SUBSTR(F_SUBSTR4, F_SUBSTR8), F_BIGSUBSTR

compatibility to FreeUDFLibC

Entrypoint substr not compatible with UTF-8 - use U_SUBSTR


Inputs/Outputs

   Input      CSTRING(8190)     String 1 (in which the position of parameter 2 is to be determined)
              CSTRING(1024)     String 2 (to be determined)
   Output     INTEGER	          first position in string 1 where string 2 starts

F_STRSUB

compatibility to FreeUDFLib, FreeUDFLib AvERP, GrUDF

Entrypoint strsub not compatible with UTF-8 - use U_SUBSTR

F_STRPOS

input/output-compatibility to rFunc (STRPOS)

Entrypoint strpos not compatible with UTF-8 - use U_SUBSTR


Inputs/Outputs

   Input       CSTRING(1024)       String 1 (to be determined)
               CSTRING(8190)       String 2 (in which the position of parameter 2 is to be determined)
   Output      INTEGER	     first position in string 1 where string 2 starts

Syntax

   F_SUBSTR, F_STRSUB etc.: Counting starts with 0, if not found -1.
   F_STRPOS: Counting starts with 1, if not found 0.
   Notice:
   In the original FreeUDFLib (1998 by Gregory Deatz) the order of the input-parameters are swapped to the other string-funktions and to the c-version (1999 by Gregory Deatz) of the FreeUDFLibC. To maintain backward compatibility for both versions there are two different “entrypoints” you can use in the DECLARE-Script of F_SUBSTR.
   - To be compatible with the (Delphi-)FreeUDFLib, the FreeUDFLib AvERP and the GrUDF (which is compatible to the Delphi-FreeUDFLib) use the entrypoint “strsub”
   - for compatibility to FreeUDFLibC use entrypoint “substr”.
   TestSQL (Version FreeUDFLibC mit Entrypoint substr)
   SELECT 9 AS ISCORRECT, F_SUBSTR('Pauline fährt in Urlaub', 'ähr') FROM RDB$DATABASE;
   SELECT -1 AS ISCORRECT, F_SUBSTR('Pauline fährt in Urlaub', 'chr') FROM RDB$DATABASE;
   SELECT NULL AS ISCORRECT, F_SUBSTR(NULL, NULL) FROM RDB$DATABASE;
   SELECT 10 AS ISCORRECT, F_STRPOS('ähr', 'Pauline fährt in Urlaub') FROM RDB$DATABASE;
   SELECT 0 AS ISCORRECT, F_STRPOS('chr', 'Pauline fährt in Urlaub') FROM RDB$DATABASE;
   TestSQL (Version FreeUDFLib, GrUDF mit Entrypoint strsub)
   SELECT 9 AS ISCORRECT, F_SUBSTR('ähr', 'Pauline fährt in Urlaub') FROM RDB$DATABASE;