Hex To String

ATTENTION: This forum is no longer active. Please navigate to our new support site at https://support.starfishetl.com/
Viewing 1 posts (of 1 total)
Anosh Wadia
User - Author
Post count: 19
#1

Am trying to do an import of Goldmine notes into SalesForce.

The notes are in Hex and need to be converted.

I'm using the following function to convert the data:

  1. Function HexToString(ByRef pstrHex)
  2. 	Dim llngIndex
  3.  
  4. 	Dim llngMaxIndex
  5. 	Dim lstrString
  6. 	llngMaxIndex = Len(pstrHex)
  7. 	For llngIndex = 1 To llngMaxIndex Step 2
  8. 		lstrString = lstrString & Chr(CLng("&h" & Mid(pstrHex, llngIndex, 2)))
  9. 	Next
  10. 	HexToString = lstrString
  11. End Function

However I keep getting a type mismatch for CLng.
Any help would be appreciated.

Thanks!
Anosh

Comments (1)

Aron Hoekstra's picture Aron Hoekstra
Administrator
Post count: 2
#2

Some versions of Goldmine store the Note as a Hex String, others store the data as a byte array. Please try this function instead:

  1. Function ByteToString(ByRef src)
  2. 	dim c, ret
  3. 	for i = 1 to lenb(src)
  4. 		c = chr(ascb(midb(src,i,1)))
  5. 		if asc(c) > 0 then ret = ret & chr(ascb(midb(src,i,1)))
  6. 	next
  7. 	ByteToString = ret
  8. End Function

Log in to post comments
Viewing 1 posts (of 1 total)

Forum Login

Login or sign up for our forums to connect to the user community.

Reply

You must log in to post.

Not a Member? Register.