1

I want to update a text like "Updating report (1 0f 5)". I thought format function will help me to do that. I want something like this

string := Format('Updating report ( %d of %d, [1], [2])', loop, count );

but it is not possible. I have an option to have loop and count stored in a string and concatenate everything. But is there any other way to achieve what i want?

0

1 Answer 1

10

Your syntax is wrong. The second parameter to the Format is an open array containing the arguments. So you need to wrap your list of arguments in what is known as an open array constructor.

An open array constructor is a sequence of expressions separated by commas and enclosed in brackets.

So, write the code like this:

str := Format('Updating report (%d of %d)', [loop, count]);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.