Convert Picture fields of a DB for 64-bit operation

This method (written v17) will convert picture fields for 64-bit use

https://forums.4d.com/4DBB_Main/x_User/3906/files/32083038.zip

<code 4D>
// Method Convert_DB_picture_fields converts picture field of the DB
// By design the new format is .jpg
//
// #SYNTAX: Convert_DB_picture_fields
// #PARAMETERS:
// None

// #DATE CREATION: 15/10/2019 #AUTHOR: Bertrand SOUBEYRAND info@soubeyrand-4d-developer.eu
// #DATE MODIFICATION: 00/00/0000
// #NOTE:

// #HEADER VERSION: 2

// Send a message if you liked this code

If (Version type ?? 64 bit version)
ALERT(“You should run a 32-bit version”)
Else

ARRAY POINTER($rP_Fields;0)
ARRAY TEXT($rT_Names;0)

C_LONGINT($i;$j)
For ($i;1;Get last table number)
	If (Is table number valid($i))
		For ($j;1;Get last field number($i))
			If (Is field number valid($i;$j))
				GET FIELD PROPERTIES($i;$j;$L_Type)
				If ($L_Type=Is picture)
					APPEND TO ARRAY($rT_Names;Field name($i;$j))
					APPEND TO ARRAY($rP_Fields;Field($i;$j))
				End if 
			End if 
		End for 
	End if 
End for 

For ($i;1;Size of array($rP_Fields))
	
	C_POINTER($P_Table)
	$P_Table:=Table(Table($rP_Fields{$i}))
	
	READ WRITE($P_Table->)
	ALL RECORDS($P_Table->)
	
	While (Not(End selection($P_Table->)))
		
		C_PICTURE($G_Signature)
		$G_Signature:=$rP_Fields{$i}->
		If (Picture size($G_Signature)>0)
			
			ARRAY TEXT($rT_Formats;0)
			GET PICTURE FORMATS($G_Signature;$rT_Formats)
			CONVERT PICTURE($G_Signature;".jpg")
			GET PICTURE FORMATS($G_Signature;$rT_Formats)
			
			$rP_Fields{$i}->:=$G_Signature
			SAVE RECORD($P_Table->)
		End if 
		
		NEXT RECORD($P_Table->)
	End while 
End for 

End if
</code 4D>