119 Posted Topics
Re: Instead of modifying 1 value (i) to try and hit on the right answer, set lower and upper limits (1 and 100) then modify the limits to narrow the range until the correct answer is the only one left. Read up about the Binary Chop algorithm. | |
Re: sl.StrictDelimiter := TRUE; sl.CommaText := NewItem.Caption+'='+IntToStr(NewItem.Tag); | |
Re: You want a language that "would be able to do mostly whatever I would like with it" but that is the key question. What *do* you want to do with it? The most suitable language for you might well depend on whether you want to write desktop software or web … | |
Re: Make a search for sample VBA code that calls the API function FindFirstFile. [Click Here](http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx) | |
Re: Study this code: var EXEName, EXEFolder, ParentFolder, DataFolder : string; begin Memo1.Clear; EXEName := Application.ExeName; EXEFolder := ExtractFilePath(ExeName); ParentFolder := ExtractFilePath(ExcludeTrailingPathDelimiter(EXEFolder)); DataFolder := IncludeTrailingPathDelimiter(ParentFolder) + 'Data'; However, although this should answer the question you asked, it doesn't answer the question you should have asked. The point pritaeas made is that … | |
Re: You could make a literal translation of that code into Delphi, but it would not be a sensible thing to do. Rather than doing a line-by-line conversion I suggest you consider what the code is doing and then think of the best way of doing that in Delphi. The simplest … | |
I am working on a web scraping project and I have to work through a series of log-in pages before I can get to the data I want. My app is basically duplicating the HTTPS requests that are sent by a browser when I use the site conventionally. To help … | |
Re: You could consider the grid just as a series of boxes with each box representing a student's attendance on one day. Color the box one color if the student attended that day and another color if they were absent. That would give a quick visual impression of their attendance record. … | |
Re: Rather than regularly rebuilding the list, can you maintain it? Every time a new user appears add him/her to your list, and remove them from your list when they go away? | |
Re: function DownloadFile(URL : string; FileName : string) : boolean; var IdHTTP: TIdHTTP; FileStream : TFileStream; begin try IdHTTP := TIdHTTP.Create(nil); try FileStream := TFileStream.Create(FileName, fmCreate); try IdHTTP.Get(URL, FileStream); finally FileStream.Free; end; Result := TRUE; finally IdHTTP.Free; end; except Result := FALSE; end; end; | |
Re: What "bit of trouble" are you having? Are you getting an error message? What is going wrong? What is `WBLoadHTML`? Each element in the string list is an HTML document. You call `WBLoadHTML` for each one. What is `WBLoadHTML` supposed to do? Open a new tab for each page? Display … | |
Re: You can use an image list and still allow users to load their own icons into that list at run time. It would be much better to load the custom images into an image list rather than load them into the list view, with all the extra work that involves … | |
Re: Plan your lessons. Especially consider how long you will talk about each topic. The first time I tried teaching I made a very detailed plan and was shocked to realise that I would run out of material long before I ran out of time. At least planning it out beforehand … | |
Re: What is dmProgramDatabase? My guess is that it is a data module and you have not created it before InitDBGrid is called. | |
Re: Does this help? http://www.xtremevbtalk.com/showthread.php?t=327076 | |
Re: The easiest way is: a) Add a TPanel to your form. Let's say you call it HiddenPanel. b) Set the Align property of the HiddenPanel to alTop and delete the panel's caption. c) Set the height of HiddenPanel to be the menu height. Do this in code in case the … | |
Re: Never used it myself but I thought the whole idea of Object Vision was that there was no coding involved, so I don't think you can hang CPP code from the forms. I think it was a way of designing front ends for databases and it generated code of some … | |
What is the process when a domain name lapses and goes into redemption? At what point is it available for purchase by a new owner? Is it possible to automate the purchase to try to ensure I buy the moment it becomes available? (So that nobody else beats me to … | |
Re: I haven't used VB for years so I won't try to write actual code but maybe I can give some clues. Taking the SendMessage parameters one by one: hwnd : I assume you show DialogHWND as a hard coded value for simplicity. In practise you should determine the value at … | |
Re: Well ultimately it must be possible, but you need more information before you can see how difficult it might be and what might be involved. The most important consideration is what type of database is in use. Legacy systems such as this may use a proprietary/in-house design, or an outdated … | |
Re: The document you linked to is rather too long to read quickly, but here are a couple of ideas where one builds on the other. First, calculate the compass heading from your current location to a target destination. Second, give some "LEFT-RIGHT" alarms as you move towards the target. If … | |
Re: My understanding of this is slightly different to yours, but probably still not right. > "Instead of creating three arrays, a single large array has been created, and portions passed in to act like separate arrays." Not exactly. This may seem like not picking, because the effect is as you … | |
![]() | Re: I suppose one approach for people who don't/won't use a "computer" is to enhance devices that they do/will use. As an example, my mother does not have nor want a computer, but she does use features on her (landline) phone for caller ID, number storage & searches, call logs and … |
Re: Search for a Windows GPS Emulator. There are a few available. There are lots of good reasons for telling your copy of Windows you are in Timbuktu, ML when you aren't. EG for some kind of simulator or game, for replaying GPS records of a trip, or testing/debugging location-based software. … | |
Re: Actually I am not sure if you can buy Delphi 8 these days. It was released in 2003. If memory serves, this version was just for .NET and was a bit of a lame duck. I would surprised if anyone could or would sell it now. | |
Re: DOS can handle 'for each PDF file in folder...' but it is a bit messy. You could do something like this: @echo off REM: 'for each PDF file in folder...' demo by SalmiSoft REM: Copies all PDFs from a number of source directories to REM: a common target directory. REM: … | |
Re: I prefer to use the dialogs included in Windows whenever possible. A quick search came up with this: http://www.codeproject.com/Articles/6080/Using-DataLinks-to-get-or-edit-a-connection-string I haven't done exactly that in VB myself, but have done something similar in Delphi. | |
Re: What OS are you working with? For Windows you could do worse than the book "Win32 Multithreaded Programming" by Cohen & Woodring. https://www.powells.com/biblio/9781565922969 OK, it is ancient now, but it is what I used years ago and I still think it is a useful resource. It is available for cheap … | |
Re: The CASE statement can be replaced by a series of IF statements. | |
Re: There are (at least) 2 easy approaches. One is to simply keep a count of how many numbers you add to each array, and do not access the array beyond that limit. You will need such a count anyway when you are populating the b&c arrays so that you know … | |
Re: You do the arithmetic before entering the data. | |
Re: else if(n < k && k < m) { cout << m << endl; cout << k << endl; cout << n << endl; } At least this output is wrong for the specified values, but I don't think this is the only error. With code like this (or any … | |
Re: I don't think it is an IF statement. I *think* it is a compiler directive, used to optimise a loop when there are no dependancies between successive loop iterations. IIRC You could just remove it and the code would be functionally the same, but slower. | |
Re: One option is to fill all bytes in the record with the value zero in one hit, rather than setting each individual field. Something like: if Pupils[Count].surname = DeleteInput then FillChar( Pupils[Count], sizeof(Pupils[Count]), 0); | |
Re: A search on any job site will show there are very few opportunities for Delphi developers compared to <language of your choice>. | |
Re: Why do you test the number to see if it is odd and then test to see if it is even? If it isn't odd it must be even, no? For a simple test for whether a number is prime, see: http://www.nickhodges.com/category/Delphi.aspx?page=4 | |
Re: In Excel when you take the "File ... Open" menu option you can change the file type to Access database. The next step is to select a data source such as a table or query. Then you see the database table in Excel. Very easy. | |
Re: I assume you are using the CreateFile API call to open the file. In the C++ app you should specify GENERIC_WRITE as the dwDesiredAccess parameter (because you want to write to the file) and FILE_SHARE_READ as the dwShareMode parameter (so that other applications can read the file at the same … | |
Re: > EnumChildWindows() isn't correct with 3rd and 4th arguments :( I find this comment a little confusing because EnumChildWindows takes only 3 parameters, not 4. The first parameter in your call to EnumChildWindows is the handle of the parent window. The second parameter in your call to EnumChildWindows is a … | |
Re: String handling can vary enormously from one situation to another. Tell us some more about what you have tried, which compiler you are using, and the source of the data. Also how is the string declared? Is it simply a string, or an ANSIString, or WideString, or ... You could … | |
Re: Yes, the property is called Hint in Delphi but it is the same thing. You will need to set the ShowHint property for the button or for the form, dependiing on how you want things to behave. Controls have a ParentShowHint property to control whether the control follows their parents … | |
Re: System.SysUtils.pas has this: DateSeparator: Char deprecated 'Use FormatSettings.DateSeparator'; | |
Re: Rather than writing a random program that you don't really need, start a library of useful routines & classes that may be useful in future projects. This may produce something useful. You can do as much or as little as you want at any time, and you can constantly add … | |
Re: There are various ways to skin that cat. The best approach depends a bit how you want the app to behave. Your first/main form will be displayed automatically. To keep that form on display in the background but force the user to use a second form, somewhere in Form1 you … | |
Re: Have you seen this: http://edn.embarcadero.com/article/27178 The data module example toward the end of the article may help you. | |
Re: You can do this with Delphi. http://www.embarcadero.com/products/delphi/ios-development | |
Re: Which size to use depends on what you want to use that size for, and I am not clear what you are trying to do. Can you give some more detail? Also note that a DC (Device Context) doesn't really have a size. It is an infinite plane for you … | |
The page source for http://www.nordpoolspot.com/Market-data1/Elspot/Area-Prices/ALL1/Hourly/ includes this latin(?) paragraph: *Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis mi eu elit tempor facilisis id et neque. Nulla sit amet sem sapien. Vestibulum imperdiet porta ante ac ornare. Nulla et lorem eu nibh adipiscing ultricies nec at lacus. Cras laoreet … | |
Re: si.nPage is the amount you should move when the user "pages" up or down. This also changes the scrollbar thumb size. si.nMax is the maximum you can scroll to. This can be any value that makes sense in your application. si.nMin is the minimum you can scroll to. Normally this … | |
Re: MSDN Says: Note The SetScrollPos function is provided for backward compatibility. New applications should use the SetScrollInfo function. I think you need to call GetScrollPos first to get the current position then call SetScrollPos to change it. |
The End.