[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Creating a array of const

Posted on 1997-10-12
Medium Priority
Last Modified: 2010-04-04
How do you create a array that can be passed to Format.  I do not know what the number and type of arguments that need to be passed until run time.
The format string is not an issue, but the argument list is.
Question by:charry
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Author Comment

ID: 1347370
Edited text of question

Accepted Solution

JimBob091197 earned 200 total points
ID: 1347371

Try the following:
procedure TForm1.Button1Click(Sender: TObject);
      Args: array[1..10] of TVarRec;
      FillChar(Args, SizeOf(Args), 0);
      Args[1].VType := vtPChar;
      Args[1].VPChar := PChar('Bob');
      Args[2].VType := vtInteger;
      Args[2].VInteger := 5;
      Caption := Format('%s %d', Args);

Declare the Args array big enough for the maximum number of arguments.  Look up help on TVarRec for the different types.

Hope this helps.

Author Comment

ID: 1347372
Thanks JimBob thats what I needed!!!!!!!!

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question