Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Any DELPHI whizz's out there?

Thread Tools
 
Search this Thread
 
Old 16 July 2003, 02:57 PM
  #1  
dela
Scooby Regular
Thread Starter
 
dela's Avatar
 
Join Date: Sep 2000
Posts: 441
Likes: 0
Received 0 Likes on 0 Posts
Post

We are developing a solution which started out as a web requirement and now needs to be handled by a rich-client.

What I want to know, is it possible to render a scrolling, dynamic form which based on the underlying data, paints the correct control types.

For example, our data file (XML) may contain 10 questions, questions 1,9 and 10 are to use a set of radio buttons for input, the rest should use a text box.

Is this possible?

cheers,
Dave

(I'm a .NET man myself - but the client isn't keen on the 80mb framework install required.)
Old 16 July 2003, 03:32 PM
  #2  
IWatkins
Scooby Regular
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
Post

With Delphi, yes it is possible.

You can import your form layout via XML, render it and then submit the answers back to a server.

Don't ask me how exactly, just seen it done.

Of course, you don't have to use XML. XML is overated in my book. Useful, but when you have control of both the server and the client end, why bother with the overhead ?

So, is this just a survey tool ? I mean if you give more info. we might be able to offer a better solution.

For instance, has the web based solution been discounted for a specific reason ?

Cheers

Ian
Old 16 July 2003, 03:44 PM
  #3  
dela
Scooby Regular
Thread Starter
 
dela's Avatar
 
Join Date: Sep 2000
Posts: 441
Likes: 0
Received 0 Likes on 0 Posts
Post

Hi Ian,

Thanks for the post.

I know what you mean about XML overhead, but unfortunately this client will operate seperately from a server, so XML becomes the best mechanism for universally saving data that the server can later import.

I was a bit gutted about the move away from web, its just due to the nature of the data being entered.

Is it true that Delphi compiles into a single EXE, so doesn't require any install at all?

cheers,
Dave
Old 16 July 2003, 04:44 PM
  #4  
IWatkins
Scooby Regular
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
Post

Dave,

OK, understood. XML is probably a good option in your case.

Yes, a Delphi project does compile into a single EXE file. The only caveat is that you use the default compiler settings which is to compile *without* run time libraries. This makes the EXE larger but you then don't need to ship the run time libraries like you do with VB (or at least used to).

Delphi allows dynamic form layout. By this I mean usually you would layout the form with buttons etc. at design time. But you can simply supply a blank form and some code that dynamically adds buttons, edit boxes, checkboxs etc. at runtime based on the code that executes.

You could simply supply an XML document with these instructions included. The first thing your blank form would do would be to parse this file, layout the controls and then store the user inputs in another (or same) XML document. These could then be upload to the server as required.

It isn't the sort of work I do with Delphi, but I think this solution is well understood.

In fact, their may even be a component (Delphi add on controls are called components) that will do most of this for you.

Cheers

Ian
Old 16 July 2003, 04:57 PM
  #5  
dela
Scooby Regular
Thread Starter
 
dela's Avatar
 
Join Date: Sep 2000
Posts: 441
Likes: 0
Received 0 Likes on 0 Posts
Post

Thanks again Ian, I now feel confident in what we are proposing to deliver.

Is there a good source for these likely components?
(I've both bought and sold controls on ComponentSource, but not sure if it touches Delphi...

Dave
Old 16 July 2003, 06:25 PM
  #6  
IWatkins
Scooby Regular
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
Post

Best bet is to have a search on the 'net, but also check out Torry's.

GaryK (of this parish) is also a proper programmer (I.e. uses Delphi ) so might have some ideas.

Cheers

Ian
Old 16 July 2003, 06:51 PM
  #7  
Robertio
Scooby Regular
iTrader: (1)
 
Robertio's Avatar
 
Join Date: Aug 2000
Location: Glasgow
Posts: 9,844
Likes: 0
Received 0 Likes on 0 Posts
Lightbulb

A very simple thing to do

For example, create a new app, stick a button on it, for the on click event put in:

var
a: TComponent;
begin
a := tLabel.Create(Form1);
with a as tlabel do
begin
left := 10;
top := 10;
caption := 'robs example';
parent := Form1;
end;
end;

When you click the button you will see a dynamically created label appear in the top left corner of the screen.

In the case where you don't know how many components you are creating (as that will depend on your XML) you should be able to use a dynamic array of TComponent. Not tried this, but can't think of any reason why it wouldn't work.

I can only get to scoobynet from home, but if you have any questions ask away
Old 16 July 2003, 09:27 PM
  #8  
carl
Scooby Regular
 
carl's Avatar
 
Join Date: May 1999
Posts: 7,901
Likes: 0
Received 0 Likes on 0 Posts
Post

IWatkins -- don't you work at the Met Office? Surely you should be using FORTRAN?

Mmm, FORTRAN. I can write in FORTRAN -- I particularly love the way that if you, say, dimension a 10 by 10 array then accidentally try to write to element (11,11) it lets you do it and just overwrites a load of important stuff in the memory (like the program code)
Old 16 July 2003, 11:09 PM
  #9  
IWatkins
Scooby Regular
 
IWatkins's Avatar
 
Join Date: Mar 2000
Location: Gloucestershire, home of the lawnmower.
Posts: 4,531
Likes: 0
Received 0 Likes on 0 Posts
Post

Carl,

Yes, (hangs head in shame) I do use FORTRAN and work for the METO. I actually use it quite a bit for create number crunching stuff that you simply cannot do in Delphi, C, C++, Java etc. FORTRAN or ASM for number crunching speed, and I know which one I prefer Usually compiled into DLLs that are called from Delphi GUIs.

Actually, FORTRAN is quite modern nowadays. Compaq Visual Fortran (CVF) and most other modern compilers actually have bounds checking built in (both compile and run time).

Cheers

Ian
Old 17 July 2003, 08:47 AM
  #10  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Post

Dave,

Yep not much to add to the good advice you've already been given, As Ian said start with torry's and do a search for delphi super page too, What version will you be using? Be aware that D7 (enterprise might) doesnt have a visual XML component but wraps the MS XML parser which does create an external dependancy so your best bet would be a 3rd party XML parser which will compile into the .exe.

As already mentioned creating components at runtime is fairly straight-forward, you can even wire up event handlers on the fly too. As for putting controls on a form if you exceed the bounds with a control the form will automatically add hor. and vert. scrollbars as necessary.

Cheers

Gary
Old 17 July 2003, 09:22 AM
  #11  
dela
Scooby Regular
Thread Starter
 
dela's Avatar
 
Join Date: Sep 2000
Posts: 441
Likes: 0
Received 0 Likes on 0 Posts
Post

Thanks all for your input.

It looks like I will go the route of rendering the controls dynamically on the page, and let it insert a horiz. scroller when necessary.

I was leafing through the "Mastering Delphi 7" book yesterday, which seemed to imply that the XML engine was part and parcel of Delphi.....can you suggest the most popular add-in parser if that isn't the case, as I wan't to stay away from depending on MSXML.

cheers,
Dave
Old 17 July 2003, 09:42 AM
  #12  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Post

Dave,

Well I looked at this the other day for a colleague who works for a company looking to use D7, when I looked through the component library source code, it references an interface to an XMLDoc (IXMLDocument) which calls MSXML via COM. In the past I used XML from CUEsoft and built a wrapper for it you can have, was three years ago so not sure if its a native VCL component or a COM object, a quick search threw this up http://www.icom-dv.de/products/xml_t...parser_01.php3 which is native and will probably do the job.

Glad to see someone else has seen the light and is using Delphi

Gary
Old 17 July 2003, 09:55 AM
  #13  
dela
Scooby Regular
Thread Starter
 
dela's Avatar
 
Join Date: Sep 2000
Posts: 441
Likes: 0
Received 0 Likes on 0 Posts
Post

It just amazes me MS haven't sorted their act out yet, all the grief that surrounds deploying an interpretted rather than compiled application is maddening.

I guess thats why I moved to Web development some time ago......
Old 17 July 2003, 10:02 AM
  #14  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Thumbs up

I know, I've only used VB very briefly in the past but cannot believe as M$ create the technology why its so badly implemented with dependancies on DLLs and OCXs left right and centre and the number of times one app. has screwed another because of versioning issues. Even more so when windows controls in VB like listviews and treeviews require OCXs not like good ol' Delphi all wrapped up nicely in the VCL and one exe and your away.

I think .net is getting there, at least they've sorted out versioning, M$ just needs to bundle the .net framework with OS and away we go. Mind you know why .net is a step in the right direction? Cos the chief architect (Anders Heijsberg) was the man responsible for Delphi!!! (But Im *heavily* biased!)

Gary
Old 17 July 2003, 01:08 PM
  #15  
Gedi
Scooby Regular
 
Gedi's Avatar
 
Join Date: Jan 2003
Posts: 932
Likes: 0
Received 0 Likes on 0 Posts
Post

Being a Linux man, I am not really a lover of anything Micro$oft. But as the new .NET framework has been mentioned here a few times, I thought some of you may be interested in this article which I found quite amusing.

http://www.securityfocus.com/infocus/1707
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
dpb
Non Scooby Related
14
03 October 2015 10:37 AM
dnb
Computer & Technology Related
2
22 March 2004 08:02 AM
Nick1
Computer & Technology Related
1
29 April 2003 08:50 AM
GialloEvoII
Other Marques
20
16 December 2002 01:28 PM



Quick Reply: Any DELPHI whizz's out there?



All times are GMT +1. The time now is 05:44 PM.