4D View v16PV Add format |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D View v16
PV Add format
|
PV Add format ( area ; string ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
area | Longint |
![]() |
4D View area | |||||
string | String |
![]() |
Format string | |||||
Function result | Longint |
![]() |
Format ID | |||||
The PV Add format command adds the format string to the area and returns its ID.
If string already exists, the PV Add format command returns its ID (this number can also be obtained using the PV GET FORMAT LIST command).
We want to remove the American monetary format available for the active area, but we must make sure that the European monetary format (Euros) is still available.
C_TEXT($OldFormat) //Format string to remove from Area
C_TEXT($NewFormat) //Format string to add to Area
ARRAY LONGINT($FormatNumArray;0) //Format numbers array
ARRAY TEXT($FormatStringArray;0) //Format strings array
C_LONGINT($Position) //Position of the format to remove in number and name arrays
$OldFormat:="$###,##0.00"
$NewFormat:="### ##0,00 EUR"
PV GET FORMAT LIST(Area;$FormatNumArray;$FormatStringArray) //List of available formats
$Position:=Find in array($FormatStringArray;$OldFormat)
If($Position#-1) //Format to remove present in area?
PV REMOVE FORMAT(Area;$FormatNumArray{$Position}) //Remove it
End if
//Format to add unavailable in area?
If(Find in array($FormatStringArray;$NewFormat)=-1)
$Position:=Size of array($FormatStringArray)+1 //We will add it
INSERT IN ARRAY($FormatStringArray;$Position) //Resize...
INSERT IN ARRAY($FormatNumArray;$Position) //...arrays
$FormatStringArray{$Position}:=$NewFormat //Assign new format
$FormatNumArray{$Position}:=PV Add format(Area;$NewFormat) //Assign number
End if
Product: 4D View
Theme: PV Style
Number:
15884
Created: 4D View 6.8
4D View Language ( 4D View v16)