sx_SetCollationRule

<< Click to Display Table of Contents >>

Navigation:  Collation and Sorting >

sx_SetCollationRule

VB Declaration

declare Sub sx_SetCollationRule Lib "Apollo9.dll"

(ByVal lRuleType As Long,

ByVal cpSrcSymbSet As String,

ByVal cpDstSymbSet As String,

ByVal bResetPrev As Long,

ByVal bOem As Long,

ByVal lReserved As Long) As Long

C Declaration

BOOL SDEAPI WINAPI sx_ SetCollationRule

(INT nRuleType,

PCHAR szSourceSymbolSet,

PCHAR szDestSymbolSet,

BOOL bResetPrevious,

BOOL bOem,

LONG nReserved);

Description

Sets the collation rule for the SDE, defining how data will be sorted. Use this to define a custom sort orders. Use one of the pre-dfined sort orders and addition rules for quick usage:

       sx_AddDudenCollation

sx_AddEtecCollation

sx_SetMachineCollation

sx_SetSystemCollation

 

See the Collation sample in C:\Program Files\Apollo7\Engine\Collation for more details.

Parameters

RuleType

ALPHABETICAL = 0  Normal linguistic rules

SPELLING = 1 ' Duden (German characters)

EXPANDING = 2  Additonal groups coalltion rule

MACHINE = 3  Simple value ordering

Collation rule order:

DEFAULT_SET = 0 ALPHABETICAL or duden or expanding default

 

Delphi Example

procedure TForm1.SetHandleCollRule;

const

 OEMSourceCharSet : Array[0..63] of Char = (#$41,#$8E,#$B5,#$B7,#$B6,#$8F,#$92,#$43,#$80,#$44,#$D1,#$45,#$D4,#$D2,#$D3,#$49,#$D6,#$DE,#$D7,#$D8,#$4F,#$99,#$E0,#$E3,#$E2,#$55,#$E9,#$EB,#$EA,#$9A,#$59,#$ED,#$61,#$84,#$A0,#$85,#$83,#$86,#$91,#$63,#$87,#$64,#$D0,#$65,#$8A,#$88,#$89,#$69,#$A1,#$8D,#$8C,#$8B,#$6F,#$94,#$A2,#$95,#$93,#$75,#$A3,#$97,#$96,#$81,#$79,#$EC);

var

 WinSrcCharSet: String; 

 DestCharSet: String; 

begin

 WinSrcCharSet := 'AÄÁÀÂÅÆCÇDÐEÉÈÊËIÍÌÎÏOÖÓÒÔUÜÚÙÛYÝaäáàâåæcçdðeéèêëiíìîïoöóòôuüúùûyýÿ'; 

 DestCharSet := 'A0A1A2A3A4A5A6C0C1D0D1E0E1E2E3E4I0I1I2I3I4O0O1O2O3O4U0U1U2U3U4Y0Y1a0a1a2a3a4a5a6c0c1d0d1e0e1e2e3e4i0i1i2i3i4o0o1o2o3o4u0u1u2u3u4y0y1y2'; 

 

 // apply Windows ETEC sets

 sx_SetCollationRule(2,Pchar(WinSrcCharSet),Pchar(DestCharSet),True,False,0);

 

 DestCharSet := 'A0A1A2A3A4A5A6C0C1D1E0E1E2E3I0I1I2I3I4O0O1O2O3O4U0U1U2U3U4Y0Y1a0a1a2a3a4a5a6c0c1d0d1e0e1e2e3i0i1i2i3i4o0o1o2o3o4u0u1u2u3u4y0y1';

 

 // apply DOS ETEC sets

 sx_SetCollationRule(2,Pchar(@OEMSourceCharSet[0]), Pchar(DestCharSet),True,True,0);

end;

 

 

See Also

Sort Order, sx_AddDudenCollation, sx_AddEtecCollation, sx_SetMachineCollation, sx_SetSystemCollation