Delphi ComboBox Items

Hello, im writing some app, and im stuck at ComboBox’es. The idea is, that when you click on a Item, that is in the ComboBox, the program must read the Text file, named by the Item name in the ComboBox, and output the content of the Text file in the MemoBox :confused: .
So, the question is, how to make the Item in the ComboBox display contents of Text file :confused:
Thanks :wink:

Regrettably, you’ve stumbled on a forum that has nothing to do with Delphi programming. Someone here may still be able to help you though.
See http://www.chiefdelphi.com/forums/showthread.php?t=29944

It’s been a while since I’ve used Delphi…but if I remember correctly, you’ll need to do the following:

  • Populate TComboBox.Items] with a list of filenames stored as Strings. If I’m not mistaken, this is a dynamic Array of String. There’s a method already provided that will let you add String variables: TComboBox.Items.Add(). Alternatively, if this doesn’t have to be changed during program operation, just use the properties window to fill in Items yourself using the …] button.]When the user clicks something to confirm their selection, or hits enter, read the selected item from the TComboBox. Store that data (i.e. a filename) in a String.]Read the file’s contents. Note that even if it’s a .txt file, there are multiple ways of reading it in.[list]]If you assign a variable of type TextFile (equivalent to type Text), it’s sequential-access, and you’ll need to parse it somehow. This depends on the input specification.]If you use type File (or File of [some type]), you’ll probably get a mess. But you’re stuck with it if you need random-access capability.
    Either way, you’ll need to use AssignFile() with the file variable (of type TextFile, File or File of [some type]) and the filename (of type String). Also, you’ll need to use Reset() and CloseFile().*]If you want to put data into a TMemo, you might consider reading a TextFile line-by-line with ReadLn(), and then outputting the result to TMemo.Lines] (dynamic Array of String).[/list]Check the help file or http://www.delphibasics.co.uk for more information on the specific functions and types.

Incidentally, as was noted by FourPenguins, this forum is typically devoted to the FIRST Robotics Competition, and discussion of related topics.