Real Software Forums

Can't get my head around this...some guidance please
Page 1 of 1

Author:  ngmp [ Tue May 14, 2013 11:42 am ]
Post subject:  Can't get my head around this...some guidance please

Hi all

I have encountered (for me at least) a wierd issue. I have an app which, when the build function allows (see an earlier post), works fine as an exe and debug run with one strange exception.

I have a routine which tabulates a given list box in a format which can be printed, saved or exported (as an csv for instance). I can call this routine for 3 separate tables. The listbox, titles etc are passed to the method (which is in a module) and a table is drawn using google api in an htmlviewer box. 2 calls to the routine work perfectly and produce a new window with the table and a couple of pushbuttons to either filter out certain parts of the table and to close the window. The table is automatically written to file in html for htmlviewer loading and for portability. No problem at at. With the 3rd call however everything works (i.e. the table is written, html file is saved (and can be opened fine) and the necessary code generated, but I lose control of the window displaying the table. i.e. nothing other than moving the whole window or closing via the top right (X) close is functioning. The pushbuttons do not close or filter, the textarea is filled in with code but the scrollbars are not functioning at all.

The only difference between the 3rd call to the first two is that the 3rd call is called from a window with an htmlviewer already open (which is showing a pie or bar chart of the data). For every chart generated the data is sent to a "history listbox" which is the source of the offending table. As I say, the table is, indeed, generated but the functionality of the the controls on the table display window seem to be deactivated.

I have tried, closing the chart htmlviewer box before sending the data to the module to reopen a fresh htmlviewer. indeed, I've tried everything obvious like renaming the viewers, step functioning the whole routine, changing the sequence of calls to the module - nothing helps and I cannot see what is happening here.

So I am simply asking for guidance in how to debug the problem not a solution per se...I just don't know how to go about finding out what's going on. I am loathe re-write the code as it took ages to get working with google api but am resigning myself to having to do that but I thought you guys might be able to help me look for things which I don't know about. How would you go about searching for the issue?

I am a newbie when it comes to object orientated or event driven software having learnt my programming with basic/fortran/pascal etc i.e. number crunching languages so this may be a trivial issue but I am totally at a loss as to where to look now and how to go about looking for the issue.

Help please !!!! .......



Author:  simulanics [ Tue May 14, 2013 2:39 pm ]
Post subject:  Re: Can't get my head around this...some guidance please

You have a function that is looping which locks up the cpu utilization of the application. When you have a processor intensive operation, a Thread can be used to run the operation in a separate "process"(literally thread)..which will leave your application usable while the operation is being performed. If you need one-on-one help, I'd be glad to lend the time.

Author:  ngmp [ Tue May 14, 2013 2:51 pm ]
Post subject:  Re: Can't get my head around this...some guidance please

Hi Mathew

Thanks for your answer...

Actually the cpu sits at 98% idle and is doing nothing other than processing normal processes.

However I have found a solution (though I do not know why this should work). If I set the work window containing the charts to .visible=false then I regain control of the table window and when closing the table window I make the chart window visible again. So it seems like a conflict with the other visible (now not visible) htmlviewer on a different window. Well at least that has sorted the problem but it is v inelegant and clumsy imo and, frankly, I do not understand why it makes such a huge difference in my app. I would have never thought of it intuitively unless forced to through a process of trial and error in debugging

Again thanks for taking the time to answer

I note you've done quite a lot with google api (maps I think)...I reckon its great stuff so thanks for putting me onto it though getting deprecated quite fast (at least some of the charting stuff is). Easy way to add charts and graphics to realstudio apps

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group