Friday, March 20, 2020

How to Declare and Initialize Constant Arrays in Delphi

How to Declare and Initialize Constant Arrays in Delphi In Delphi, the versatile web-programming language,  arrays allow a developer to refer to a series of variables by the same name and to use a number- an index- to tell them apart. In most scenarios, you declare an array as a variable, which allows  for array elements to be changed at run-time. However, sometimes you need to declare a constant array- a read-only array. You cannot change the value of a constant or a read-only variable. Therefore, while declaring a constant array, you must also initialize it. Example Declaration of Three Constant Arrays This code example declares and initializes three constant arrays, named Days, CursorMode, and Items. Days is a string array of six elements. Days[1] returns the Mon string.CursorMode is an  array of two elements, whereby declaration CursorMode[false] crHourGlass and CursorMode crSQLWait. cr* constants can be used to change the current screen cursor.Items defines an array of three TShopItem  records. type   Ã‚   TShopItem record   Ã‚  Ã‚  Ã‚   Name : string;   Ã‚  Ã‚  Ã‚   Price : currency;   Ã‚   end; const   Ã‚   Days : array[0..6] of string   Ã‚   (   Ã‚  Ã‚  Ã‚  Ã‚  Sun, Mon, Tue, Wed,   Ã‚  Ã‚  Ã‚  Ã‚  Thu, Fri, Sat   Ã‚   ) ;   Ã‚   CursorMode : array[boolean] of TCursor   Ã‚   (   Ã‚  Ã‚  Ã‚   crHourGlass, crSQLWait   Ã‚   ) ;   Ã‚   Items : array[1..3] of TShopItem   Ã‚   (   Ã‚  Ã‚  Ã‚   (Name : Clock; Price : 20.99),   Ã‚  Ã‚  Ã‚   (Name : Pencil; Price : 15.75),   Ã‚  Ã‚  Ã‚   (Name : Board; Price : 42.96)   Ã‚   ) ; Trying to assign a value for an item in a constant array raises the Left side cannot be assigned to compile time error. For example, the following code does not successfully execute: Items[1].Name : Watch; //will not compile

Tuesday, March 3, 2020

3 Questions About Emphasis

3 Questions About Emphasis 3 Questions About Emphasis 3 Questions About Emphasis By Mark Nichol The following questions from readers, and the responses, pertain to how words are formatted to provide emphasis. 1. When writing business documents such as Standard Operating Procedures or Workflow processes, my understanding has always been that you capitalize titles. An example of that would be â€Å"The Project Coordinator will send the Systems Architect the following information to begin the quoting process.† When you are describing a specific role in a business process, is it OK to capitalize the title? In legal documents, descriptive terms for entities such as Plaintiff or Corporation have traditionally been capitalized to emphasize for the purposes of legal precision that they refer to specific entities and not, for example, any plaintiff or corporation in general. This usage apparently spilled over from the legal department into the rest of the corporate headquarters without question at one time and became entrenched. It is â€Å"OK† to capitalize job titles as you have shown, but there’s no reason to do so, and it has a distracting, cluttering effect. I recommend reserving capitalization for when it provides clarity, as in communicating that a phrase before a person’s name is that person’s official job title, not just a description of or label for his or her role. For that matter, though you may title a document â€Å"Standard Operating Procedures† or â€Å"Workflow,† in your first sentence, you are referring generically to the type of documents you are writing, not to specific documents so titled, so the terms should not be capitalized. 2. In a document in which personality characteristics are used to describe roles in our company, we are using labels like â€Å"The Champion† and â€Å"The Catalyst.† Is the way the labels have been formatted correct? [Editor’s note: The labels were not only capitalized and italicized but also styled in boldface in the reader’s email message.] Several layers of emphasis have been used for these labels, which is redundant. Only one is necessary, and simple capitalization of the key terms is sufficient to indicate that you are naming well-defined roles. The article the should not be capitalized, however. (Nor should quotation marks be used to frame the labels in the actual document.) 3. I think that in the following sentence, infrastructure should be italicized, but my manager disagrees: â€Å"By infrastructure, we mean the company’s policies, internal activities, organization, reporting and systems related to managing risk.† Who’s right? You are. For the same reason that infrastructure is italicized in your opening statement and here in my response- we’re both using the word to refer to the word itself, not to the phenomenon of infrastructure- it should be italicized in the example you gave: The sentence defines not the concept, but the word by which the concept is known. Want to improve your English in five minutes a day? Get a subscription and start receiving our writing tips and exercises daily! Keep learning! Browse the Style category, check our popular posts, or choose a related post below:15 Terms for Those Who Tell the FuturePeople versus Persons20 Slang Terms for Law Enforcement Personnel