119 Posted Topics

Member Avatar for haulover

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.

Member Avatar for Maritimo
0
383
Member Avatar for Simon180
Member Avatar for SalmiSoft
0
155
Member Avatar for Scott_9

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 …

Member Avatar for Scott_9
0
320
Member Avatar for Papa_Don

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)

Member Avatar for Minimalist
0
330
Member Avatar for Simon180

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 …

Member Avatar for SalmiSoft
0
198
Member Avatar for Simon180

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 …

Member Avatar for Simon180
0
223
Member Avatar for SalmiSoft

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 …

Member Avatar for SalmiSoft
0
205
Member Avatar for yatesy900

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. …

Member Avatar for SalmiSoft
0
91
Member Avatar for Simon180

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?

Member Avatar for Simon180
0
181
Member Avatar for Simon180

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;

Member Avatar for Simon180
0
180
Member Avatar for Simon180

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 …

Member Avatar for SalmiSoft
0
132
Member Avatar for Simon180

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 …

Member Avatar for SalmiSoft
0
245
Member Avatar for chloe.baee

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 …

Member Avatar for Agilemind
0
430
Member Avatar for MasterHacker110

What is dmProgramDatabase? My guess is that it is a data module and you have not created it before InitDBGrid is called.

Member Avatar for MasterHacker110
0
184
Member Avatar for LukeJWhitworth
Member Avatar for SalmiSoft
0
121
Member Avatar for Simon180

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 …

Member Avatar for SalmiSoft
0
239
Member Avatar for rory.starkweather.7

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 …

Member Avatar for drianhodgson
0
444
Member Avatar for SalmiSoft

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 …

Member Avatar for pritaeas
0
85
Member Avatar for PinoyDev

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 …

Member Avatar for SalmiSoft
0
857
Member Avatar for zainab_8271

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 …

Member Avatar for SalmiSoft
0
191
Member Avatar for Mya:)

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 …

Member Avatar for Deonas666
0
747
Member Avatar for DavidB

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 …

Member Avatar for taichichuan
0
239
Member Avatar for Ralphael

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 …

Member Avatar for SalmiSoft
0
160
Member Avatar for zachattack05

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. …

Member Avatar for zachattack05
0
190
Member Avatar for Ojo_1

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.

Member Avatar for pritaeas
0
312
Member Avatar for toomutch

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: …

Member Avatar for SalmiSoft
0
347
Member Avatar for Santanu Das

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.

Member Avatar for Santanu Das
0
229
Member Avatar for nitin1

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 …

Member Avatar for Moschops
0
164
Member Avatar for Razi_1
Member Avatar for Razi_1
0
1K
Member Avatar for sahil_4

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 …

Member Avatar for pritaeas
0
136
Member Avatar for andrew mendonca
Member Avatar for andrew mendonca

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 …

Member Avatar for Taywin
0
3K
Member Avatar for DavidB

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.

Member Avatar for SalmiSoft
0
543
Member Avatar for zack2313

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);

Member Avatar for Jack_10
0
973
Member Avatar for Mya:)

A search on any job site will show there are very few opportunities for Delphi developers compared to <language of your choice>.

Member Avatar for Matt_13
0
495
Member Avatar for SkyCross

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

Member Avatar for SalmiSoft
0
922
Member Avatar for mcdczzz

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.

Member Avatar for Stuugie
0
436
Member Avatar for kshahnazari

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 …

Member Avatar for Ketsuekiame
0
305
Member Avatar for cambalinho

> 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 …

Member Avatar for cambalinho
0
1K
Member Avatar for Sheryl_1

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 …

Member Avatar for SalmiSoft
0
219
Member Avatar for Mya:)

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 …

Member Avatar for Mya:)
0
384
Member Avatar for finalist
Member Avatar for finalist
0
580
Member Avatar for Mya:)

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 …

Member Avatar for Mya:)
0
359
Member Avatar for Mya:)

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 …

Member Avatar for Mya:)
0
5K
Member Avatar for William Darrah

Have you seen this: http://edn.embarcadero.com/article/27178 The data module example toward the end of the article may help you.

Member Avatar for William Darrah
0
157
Member Avatar for MasterHacker110

You can do this with Delphi. http://www.embarcadero.com/products/delphi/ios-development

Member Avatar for SalmiSoft
0
329
Member Avatar for cambalinho

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 …

Member Avatar for cambalinho
0
384
Member Avatar for SalmiSoft

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 …

Member Avatar for SalmiSoft
0
363
Member Avatar for cambalinho

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 …

Member Avatar for cambalinho
0
241
Member Avatar for cambalinho

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.

Member Avatar for cambalinho
0
977

The End.