Hudson Posted October 16, 2009 Posted October 16, 2009 I am working with tables now in OpenDCL and I'm getting it down. I've got 4 columns and when someone adds to the list, I want to insure that the data is unique. I imagine I need a loop for this, what's the most effective way to go about it? Thanks for any and all help. Andrew Quote
JohnM Posted October 17, 2009 Posted October 17, 2009 Are you using the grid control? If you are using a grid control, which drop down are you using? Please supply more detailed info in what controls you are using For now I’ll just guess you are using the grid control. I’m currently working on a project with the same issues using the grid control with drop down list. Use the grid control “BeginLabelEdit” event and then GetCellDropDownList to get the current list Use the grid controls “EndLabelEdit” event. This event is fired after the control is edited. Then uses GetCellText to retrieve the new entry and compare it to the list from GetCellDropDownList (If (member GetCellDropDownList GetCellDropDownList)) –not actual code just an example. This is just the basic suggestion. Depending on what you are coding it can be totally different. Example. My project allows the user to add an item by typing into the edit box or clicking on the column header, which displays a dialog box for adding and deleting items in the list. My lists are loaded from a saved file, so when the program starts it finds the file and if it’s not nil it loads the list. When the user adds an item via the edit box the “EndLabelEdit” event runs a routine to get the info from the saved file and uses GetCellText so I can compare to see if it already in the list. If not add it to the list I retrieved from the file then re-write the file with the net item appended to it. Again depending how you are formatting your saved list you might just append the new item to the saved file. Now just use SetCellDropDownList to load the new list into the dropdown list of the grid. It can get more involved than this but I hope I have at least help a little Quote
Hudson Posted October 19, 2009 Author Posted October 19, 2009 Thanks for that information John. Yes I am using grids. However I am not using drop down at this moment. It looks like a fair amount of work to accomplish full error/duplication trapping. I think I'll skip it for now as only 2 people are going to be using the program.. Although I am going to have to become familiar with routines that can run through lists looking for data.. All in all, I'm finding OpenDCL amazing.. sometimes frustrating, but that's usually my limitations! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.