**IF** I understand what you are trying to do....
you are halfway there in both cases, and is fairly easy.

I think what you want is:
String+Hex[[1]]+Hex[[2]]+...+Hex[[n]]

Example:
"This is my string of which I want the length"
(decimal) 44 characters
44 (dec) = 2C (hex)

final value:
"This is my string of which I want the length2C

so...
$Text:=<text to work with>
$Hex_Length_txt:=myutl_Convert_to_Hex(LENGTH($Text))
$Text:=$Text+$Hex_Length_txt

code for converting to hex:
PHP Execute("";"dechex";$Hex_Value;$Decimal_Value)
NOTES:
- this has a max decimal conversion value of +/- MAXLONGINT
- the hex value is returned in $Hex_Value
- "dechex" is the PHP library command
- first empty string is library path ("" = main/basic PHP library)


On Thu, 21 Feb 2019 21:09:51 +0000, Peter Mew via 4D_Tech wrote:
> Hi
> This is driving me mad, so I hope someone will point me in the right
> direction.
> I have a string of text.
> I can find its length in Hex. now I want to write this length as 4 hex
> bytes, into the string, with the aim of doing a text to blob, later on.
> If I just add the Hex Number to the string it takes 8 bytes
> (String+HexByte0+HexByte1+HexByte2+HexByte3)
> If I convert the Hex Numbers to decimal and Do
> String+char(DecByte0)+char(DecByte1) etc.
> It takes up 4 Bytes but the Numbers written to the string are wrong.
> Please help
> thanks
> -pm
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to