Показать сообщение отдельно
Старый 12.05.2016, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
palleagermark: A dynamic strFmt call
Источник: http://www.agermark.com/2016/05/a-dy...rfmt-call.html
==============

In the communities a users asked about a way to make a dynamic strFmt call, not knowing the number of parameters up front.

With some good critical tests from Levgen Miroshnikov (blog) I think I have managed to write a class method that does that.

Regular StrFmt will round decimal value and change the decimal point to whatever fits your windows locale. This method has a parameter allowing you to keep the formatting of decimal values.

Here is the code for it:
public str dynamicStrFmt(
str _expression,
container _args = conNull(),
boolean _keepRealsDecimals = false)
{
str ret;
Counter counter;
str argStr;
char argChar;

if (_args == conNull())
{
return strFmt(_expression);
}

for (counter = 1; counter
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.