StrToBoxDef
From SCAR Divi Manual
Definition
function StrToBoxDef(const Str: string; const Default: TBox): TBox;
Availability
SCAR Divi 3.37 > Current
Notes
- Before 3.38, the function had some flexibility issues with the input.
Description
Converts a given string Str to a TBox. If the given string is not in an acceptable format, the function will return the box given by Default.
Example
begin WriteLn(BoxToStr(StrToBoxDef('1,2,3,4', Box(4, 3, 2, 1)))); WriteLn(BoxToStr(StrToBoxDef('1,2 ,3, 4', Box(4, 3, 2, 1)))); WriteLn(BoxToStr(StrToBoxDef('1,2 ,3, 4)', Box(4, 3, 2, 1)))); WriteLn(BoxToStr(StrToBoxDef('(1,2 ,3, 4)', Box(4, 3, 2, 1)))); WriteLn(BoxToStr(StrToBoxDef('(1,2,3,4)', Box(4, 3, 2, 1)))); WriteLn(BoxToStr(StrToBoxDef('(1 2 3 4)', Box(4, 3, 2, 1)))); end.
Output:
(1,2,3,4) (1,2,3,4) (1,2,3,4) (1,2,3,4) (1,2,3,4) (4,3,2,1)