KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Case-Sensitive Password System
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: February 6, 2002

Compatibility: 6.5.x and 6.7x

If you need to devise a custom password system, you will most likely want it to be case-sensitive. 4D's string comparison is not case-sensitive. For instance, these two strings are considered to be

equal in 4D: "hello" and "HeLLo". It is easy to write a method that can tell these strings apart.


`Project Method: GEN_StringsAreIdentical

`Example: $fIdentical:=GEN_StringsAreIdentical("hello";"HeLLo")


$tString1:=$1

$tString2:=$2

C_LONGINT($iIdx)


Case of

 : (Length($tString1)#Length($tString2))

  $0:=False

 Else

  $0:=True


  For ($iIdx;1;Length($tString1))


   Case of

   : (Ascii($tString1?$iIdx?)#Ascii($tString2?$iIdx?))

   $iIdx:=Length($tString1)+1

   $0:=False

  End case

  IDLE

  End for

End case