I want something like a function where I can pass in the month number and get back the name for the month or perhaps even a function where I pass in a TDate and get back the month name for that TDate.
I've specified US English locale because that's what you asked for in the question. But of course you could use different locales, or not specify a locale in which case the user's locale would be used.
The TaxRateLabel.Caption equals 7%, and so the StrToFloat is passing just the 7 character. The TaxRate field is defined in the database as a BCD field with 2 decimal places. I don't see any minimum or maximum values set in the database, so why is this producing the number out of range error?
I need to change a large number of Delphi components defined in one package to similar ones in another package.Much of the grunt work can be done by replacing text (component types and properties) in the DFM files - saved as text of course.
B and C differ in that the order of their X and Y subcomponents is reversed. The precise meaning of subcomponent order depends on the components (see below), but most notably, if they're TWinControl descendants, or they are both TControl descendants that do not derive from TWinControl, that means they differ in whether X is shown over Y, or Y over X.
Removing these numbers may change the forms, so you shouldn't blindly do it. However, depending on your goal, you may be able to modify the parser (source code appears to be available) to simply skip over the numbers.
For normal controls, the subcomponents start with (1) TControl descendants that do not derive from TWinControl, then (2) TWinControl descendants, finally (3) any non-TControl components. In each of these, the relative order of components is adjustable: for controls, the "Bring to front" and "Send to back" move the control as far as possible, with the limitation that a non-TWinControl can never be put after a TWinControl. For non-controls, the (slightly misnamed) "Creation order" option allows you to change the order. So, let's say you have two labels (A and B), two edit controls (C and D), and a dataset and data source (E and F), you can get the order to be for example, ABCDEF, BACDEF, ABDCFE, but not ACBDEF.
That order is preserved when saving to a DFM file: when visual inheritance is not used, components simply get saved and re-loaded in order. When you do use inheritance, the DFM files get processed base to derived, so in the above case, when TC is created, its X member is always created before its Y member. The [0] and [1] are needed to tell the Delphi RTL to fix up the order afterwards, in those cases where the component order matters.
What the component order actually does depends on the component type. As the "Bring to front"/"Send to back" names suggest, controls use the component order to specify the Z order. For other component types, it means whatever the component wants it to mean. For example, menus can use the component order to specify the order of their menu items (top to bottom). Toolbar controls can use the component order to specify the order of the toolbar buttons, even when those toolbar buttons aren't themselves controls. Data sets use the component order to specify the field order, and thereby also the default order of columns in a TDBGrid.
It was tested against RAD Studio source files and our own production code and it parses all and generates the files byte for byte. The aim was to have an easy way to change DFM trees and produce output that looks like it was created by RAD Studio.
Since Embarcadero's NNTP server stopped responding since yesterday, I figured I could ask here: I work with a non-DB-aware grid, and I need to loop through a dataset to extract the number of columns, their name, the number of rows and the value of each fields in each row.
If you want more information about fields, the TFields object (ASQLite3Query1.Fields) has a default property and a Count property, so you can use it like an array, and an enumerator, both of which can be used to loop over each TField object and retrieve its metadata.
The current solution I have is forking a pdftk process, and parse its output. But this is quite slow, so I was wondering if I could find a good open-source pdf parser library for delphi (5...)... And it seems it doesn't exist.
So I tried to implement things like looking into the file's raw content for occurences of "/Type /Page" or "/Count" or "Linearized ... /N". But none of these -nor a combination of them- work in every case.
So I wondered if I could find an open-source DLL that I could make use of from Delphi 5. But I couldn't find any neither. I stumbled upon iTextSharp but it is for .NET and I don't understand howto use it in a plain delphi5 program...
Please note: Plain text e-mail (non-encrypted) is not secure and should not be used to communicate confidential, sensitive, and/or personal information. The confidentiality and security of information sent via e-mail cannot be guaranteed. Confidential, sensitive, and/or personal information includes, but is not limited to, your social security number, driver's license number, state identification card number, bank account number, credit card number, debit card number, medical information, etc. By submitting information via e-mail to this office, you hereby agree that none of the information contained in your communication is confidential, sensitive, or personal. You further agree that this office and the web hosting company shall not be held liable for any breach of confidentiality, breach of security, or similar cause of action resulting from use of e-mail with this office, including any liability for the negligent handling, use, or storage of information contained in your e-mail. Please call our office if you wish to provide sensitive information.
Do it like your digital camera does; Have a counter and save it in a file or in the registry. You'll probably run into multi-user problems and you'll still have to handle situations where an image already exists.
Do something like the code below to find the latest number. I think this does what you're describing, but remember that this code will get slower as you write more images. With thousands of pictures and a slow drive or network it could 'hang' your program.
At program startup, iterate all Screenshot*.bmp files, parse out the numeric part and find the highest - assign this value to your counter. When doing a snapshot, go into a loop that tries crreating Screenshot.bmp with "only create if doesn't exist already" (CREATE_NEW) semantics, incrementing the counter until you find an unused name.
is it possible to get source line number at runtime in Delphi?I know JCL debug, but I want to avoid to use it. Also Assert is not exactly what I want. I would like to get something like this, where GetLineNumber would get the source line number. Is it possible to do it without MAP files (anyway will MAP file be generated when I use Assert) ? Is there any example ?
You can indeed use Assert for this. Write a procedure that matches the signature dictated by the TAssertErrorProc type, and then do whatever you want there. To preserve the expected behavior, you should probably call the original handler after you're finished.
A .map can be parsed into a binary compressed version (.mab proprietary format), which is much smaller than the original .map. For instance, a 900 KB .map file is compressed into a 70 KB .mab file - this is a much higher compression than zip.
It's not practical to litter your source code with pre-emptive checks for errors. What's more, doing so will only give you very limited information for a very limited number of faults in your code. Generally, if you can anticipate an error, you won't get it wrong. It's the errors that you don't anticipate that make it into production code.
Delphi surveys with panels of experts in a particular area of interest have been widely utilized in the fields of clinical medicine, nursing practice, medical education and healthcare services. Despite this wide applicability of the Delphi methodology, there is no clear identification of what constitutes a sufficient number of Delphi survey participants to ensure stability of results.
The study analyzed the response characteristics from the first round of a Delphi survey conducted with 23 experts in healthcare quality and patient safety. The panel members had similar training and subject matter understanding of the Malcolm Baldrige Criteria for Performance Excellence in Healthcare. The raw data from the first round sampling, which usually contains the largest diversity of responses, were augmented via bootstrap sampling to obtain computer-generated results for two larger samples obtained by sampling with replacement. Response characteristics (mean, trimmed mean, standard deviation and 95% confidence intervals) for 54 survey items were compared for the responses of the 23 actual study participants and two computer-generated samples of 1000 and 2000 resampling iterations.
Panels of similarly trained experts (who possess a general understanding in the field of interest) provide effective and reliable utilization of a small sample from a limited number of experts in a field of study to develop reliable criteria that inform judgment and support effective decision-making.
Since its development in the 1950's, the Delphi method has been broadly utilized in various fields of study including clinical medicine, nursing practice, medical education and healthcare services [1, 2]. Despite its wide application, however, many questions regarding this methodology still continue to intrigue researchers. One such question is whether small expert samples are sufficient to conduct a Delphi study; sufficient in this case refers to the stability of panel responses.
In this methodological paper, the adequacy of utilization of a small number of experts in a Delphi panel is discussed. Computer software (SPSS 12.5) was used to augment the data from the first round of a Delphi survey conducted with 23 healthcare quality and patient safety experts and to study the similarities and differences between the response characteristics of the original data and the computer-generated samples.
7fc3f7cf58