When using 4D Write, you may want users to be able to modify/create/delete style sheets. The consequence of that is that the style sheet reference number may change over time. Using 4D Write's language, you can retrieve the reference of any given style sheet. All you need to know is its name. The following piece of code displays the reference number of the style sheet named "MyStyleSheet", in the area "Field3".
ARRAY STRING(31;$StyleSheetName;WR Count (Field3;wr nb stylesheets ))
$StyShCount:=WR Count (Field3;wr nb stylesheets )
WR GET STYLESHEET INFO (Field3;$i;$Name;$applyTo;$protected;$shortcut)
$StyleSheetRef:=Find in array($StyleSheetName;"MyStyleSheet")