StrToBoxDef

From SCAR Divi Manual
Revision as of 14:15, 26 November 2012 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function StrToBoxDef(const Str: string; const Default: TBox): TBox; </source> ==Availability== SCAR Divi 3.37 > Current ===...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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)

See Also