Sample code for 30+ languages & platforms
PowerBuilder

Example: Crypt2.CrcBd method

Demonstrates how to call the CrcBd method.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
oleobject loo_Crypt
oleobject loo_Bd
integer li_Crc32
integer li_Crc8

loo_Crypt = create oleobject
li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2")
if li_rc < 0 then
    destroy loo_Crypt
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Bd = create oleobject
li_rc = loo_Bd.ConnectToNewObject("Chilkat.BinData")

loo_Bd.AppendString("123456789","us-ascii")

li_Crc32 = loo_Crypt.CrcBd("crc-32",loo_Bd)
// The decimal value is 3421780262 (converted to hex is 0xCBF43926)
Write-Debug string(li_Crc32)

li_Crc8 = loo_Crypt.CrcBd("crc8",loo_Bd)
Write-Debug string(li_Crc8)


destroy loo_Crypt
destroy loo_Bd