Reading a Delphi record file from PHP?

Please discuss general Delphi programming topics here.

Reading a Delphi record file from PHP?

Postby ristuart » August 30th, 2003, 8:57 am

Hi,

I have an application that is currently able to export data to a Delphi file of records, each with several fields containing strings, integers and a boolean.

Would it be at all possible to have a web-based scripting language such as PHP extract data from these record files?


Thanks for your time,

ristuart :)
ristuart
Member
Member
 
Posts: 4
Joined: August 30th, 2003, 8:53 am

Postby Johnny_Bit » August 30th, 2003, 6:12 pm

Well of course! Firstly i think to make a sample file with this records in, and to analyze them in hex editor, then a one mistake hit me: what about lillte endian and big-endian?

You know, I don't know PHP i I don't know if there's any Integer to string (in both directions) functions, but only one reasonable thing comes to my head: analyze Ini Files. they got exacly what you newed, but there are preety slow, so.. well i don't knwo :(
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby ristuart » September 1st, 2003, 7:49 am

I'm afraid that reply lost me... by "analyze ini files" do you just mean think about using INI files instead of the binary record files, or does the analyze mean something I've missed?

The record file does seem well suited to the task the application is doing at the moment.


Thanks,
ristuart
ristuart
Member
Member
 
Posts: 4
Joined: August 30th, 2003, 8:53 am

Postby Johnny_Bit » September 1st, 2003, 3:07 pm

I'm saying that you should try use INI files, 'cause binary record files may cauese weird bug in systems that has diffrent littleendian/bigendian system.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby richardchaven » September 2nd, 2003, 9:57 pm

In what context would, "... a web-based scripting language such as PHP extract data from these record files..." ?

What do you want to do with the data? Create HTML with it?

Cheers
richardchaven
Active Member
Active Member
 
Posts: 20
Joined: May 30th, 2003, 1:30 pm

I feel a bit impolite...

Postby ristuart » January 12th, 2004, 5:32 pm

Hello again,

My apologies for not replying before, and also for bringing such an old topic up again. I don't regularly visit this forum, and, although I'd read Johhny Bit's second reply I didn't get another e-mail notification, and haven't checked back here until I happened to find an old link!

The context... well, the script would most likely extract the data from the record file and enter it into a database (e.g. MySQL) for later use. I'm not exactly sure what you mean by the context. The aim was to allow users to have data exported from the program (written in Delphi) and upload it to a web-based interface (ideally written in PHP), where it'd be imported and then used.

Why do you ask? If I've not explained adequately, particularly as I'm not quite sure what you're getting at, would you mind explaining what you meant again?

Thanks for your time,
ristuart
ristuart
Member
Member
 
Posts: 4
Joined: August 30th, 2003, 8:53 am

Postby Johnny_Bit » January 12th, 2004, 8:22 pm

hmm... why don't you try to write this data directly to DataBase? It would be good, and there's no way of supid bigendian\littleendian diffrences.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Not a central web-based interface

Postby ristuart » January 12th, 2004, 9:32 pm

The web-based interface isn't going to be run by myself - it'd be a set of scripts users could optionally run on their own sites if they like, in addition to using the software. I guess I could have users enter info for a database to connect to, and have it done automatically in that way... hmm... this would be worth my considering, thanks. Quite why it hadn't occured to me that this could be more practical before, I don't know. :shock:

It's not too important if the bigendian/littleendian problems are going to make reading a Delphi record file from PHP impractical, I was just wondering really. Thanks for your input. :)
ristuart
Member
Member
 
Posts: 4
Joined: August 30th, 2003, 8:53 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron