|
-
December 22nd, 2003, 04:22 PM
#1
King of the Mermaids
-
December 22nd, 2003, 06:06 PM
#2
Driver Terrier
Define "interface"
What does the program have to do with the variable length file?
-
December 26th, 2003, 09:34 PM
#3
Registered User
 Originally Posted by Diver01
Just a general question/small rant about programming...
Is is really THAT difficult to write an interface to a varaible length file. I know im not a professional programmer but I have taken classes and written a few programs myself. I just dont get it.  :butt: 
Variable length?
Are you referring to variant records by chance?
-
February 3rd, 2004, 04:15 PM
#4
Registered User
like hwo much you can write to a file?
-
February 3rd, 2004, 04:28 PM
#5
King of the Mermaids
I was having a really bad day and needed someplace to vent...
Yes I was talking about variable length records (Sorry for the confusion)
Yes I have very limited experience writing to a file. I hope to gain more as I try and continue my VBasic training this year.... Atleast thats why I keep promising myself I would like to try and do... Just need to get my hands on a recent copy of VB.
-
February 4th, 2004, 01:26 AM
#6
Driver Terrier
-
February 4th, 2004, 08:36 AM
#7
Geezer
-
February 4th, 2004, 08:41 AM
#8
Driver Terrier
oracle handles variable length fields. I don't know what's in the files he refers to, but if it is database type data, then oracle can handle it.
-
February 4th, 2004, 09:01 AM
#9
Geezer
 Originally Posted by NooNoo
oracle handles variable length fields. I don't know what's in the files he refers to, but if it is database type data, then oracle can handle it.
& ? ...VB knows about variable length records, C knows about variable length records, Pascal knows about them, infact pretty much every programming language I can think of knows about them & some non programatical stuff like databases 'know' too !
String handling in VB is very much like any other language you need to be able to find lengths of strings, change their types so you can operate on them, strip characters in & out, swap characters, compare characters - yada yada yada !!! - string handling is a pain in any language, but they all have sufficient operators to handle it if they can define that as a TYPE that the language accepts.
-
February 4th, 2004, 09:15 AM
#10
Driver Terrier
True.... I guess we don't get what the problem is....
-
February 4th, 2004, 09:50 AM
#11
King of the Mermaids
 Originally Posted by NooNoo
True.... I guess we don't get what the problem is....
That was my point to begin with. The file in question was an ascii file with variable length records. In one particular area of the country, it doesnt seem to matter who I talked with, nobody knew how to write a program that knew how to deal with a variable length records. I know it can be done. I know other people can do it. I was frustrated because these other vendords refused. Caused me a lot of headaches and an extra days worth of work. Job security I guess...
-
February 4th, 2004, 10:39 AM
#12
Geezer
Finally I get the problem ... so the records were created by some other application & have non standard record markers & seperators then ?
So you'd have to read the entire record & parse it into fields yourself (by searching each string for markers, but if its big{exceeds the maximum single record size} it gets pretty tricky pretty quick) & then read that, but that's sort of past beginner level programming ... not expert, but intermediate to - too bloody hard for me
-
February 4th, 2004, 11:24 AM
#13
King of the Mermaids
Each field type has a marker within the file. For Example:
1(32)Beer(36)5.00
2(32)Cigarettes(33)1.50(34)02042004(35)02102004(36 )3.00
(32) in this case would equal a Description
(33) would be a Sale Price
(34) Would be Start Date
(35) Would be End date
(36) is a regular retail
The 1 and 2 is the record #.
Note: This is not an issue I am currently having. It is just a curiosity to me on how difficult it would be to write an app in VB that could translate a file that is variable length. I will be trying to learn how to do this later this year using VB.
Last edited by Diver01; February 4th, 2004 at 11:32 AM.
W
-
February 4th, 2004, 01:15 PM
#14
Driver Terrier
Translate it to what?
you would read the file into an array... space filling as appropriate.
-
February 4th, 2004, 01:44 PM
#15
Geezer
Roughly here's how ...
Right so what you've got is a big list of data, seperated into fields, but with an ascii file you'd have seperators between each entry of a line feed or comma or somesuch (or the ascii char for it) & a carriage return at the end of each line or record.
So what you do is get the length of the record (as long as its not more than 32k -which is when it gets hard) then you read each character in turn into an array of chars until you reach your first seperator, that then gets set as = to field one of your record, clear your array .. repeat until you find the end of record marker. Read next record, repeat etc..
If you haven't got any seperators as its literally described in the question, it'd be mighty hard indeed, as ascii files don't contain any info about field lengths like say a binary record might.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks