Page 1 of 1

pole.dat

Posted: Thu Jan 26, 2006 8:27 pm
by balloonbuffoon
Hello,
I'm thinking I might make a BIGPOLE type program, but I need to fully understand the POLE.DAT file. Dale, I've looked at your page about file formats and almost completely understand the file, but not exactly. Here's what I think it all means: (I use "Line" for each block of 20 chars.)
  • Line 1: Product description
    Line 2: Quanty X Single Price = Total
    Line 3: Chars 1-15 is the stock num; Char 16 is "RD"; Chars 17-18 is the type (0 = "", 1 = "PURCHASE", or 2 = "RETURN / PAYOUT"), Chars 19-20 is "DIFF"
    Line 4: Chars 1-2 is decimal/no decimal (0 or 100); Chars 3-6 is the Net Total; Chars 7-10 is the Tax Rate; Chars 11-14 is the Total; Char 15 is "UP"
If that is correct, then:
  • What is "RD"? (used for, all possible values, etc) The real value is the ASCII code of the string RD?
    What is "DIFF"? (used for, all possible values, etc)
    What exactly does the CVL() function do, that it is used on the Net Total, Tax Rate, and Total? (Decoding of some sort? Is this an exclusively QBASIC function?)
    What are the possible values for decimal/no decimal and what does each case mean? (when is each case used) What is the CVI() function?
    What is the "UP" value used for?
Thank you!

--Steve

POLE.DAT specifics

Posted: Sun Jan 29, 2006 5:44 pm
by Dale Harris
Steve,

Q1) Line 1: Product description Line 2: Quanty X Single Price = Total
A2) Not neccessally. Record #1 contains the text that is supposed to be displayed on the top line of the pole display and record #2 contains the text that is supposed to be displayed on the second line of the pole display. For example before a transaction record #1 will contain "WELCOME TO...." and the second line will contain the store name.

Q2) What is "RD"? (used for, all possible values, etc) The real value is the ASCII code of the string RD?
A2) RD tells you if the data in records 1 and 2 are from a "discount / reduction" or a "price change." The REMOTE.EXE program uses the value of RD to decide if the information displayed from records 1 and 2 should be highlighted in a different color. Possible values are 0, 1, or 2.

Q3) What is "DIFF"? (used for, all possible values, etc)
A3) Every time the information in POLE.DAT is updated the value in DIFF is incremented by 1. Therefore when the value in DIFF changes it is time to update the pole display. Possible values are 0 to 32768 at which point the value is reset to 0.

Q4) What exactly does the CVL() function do, that it is used on the Net Total, Tax Rate, and Total? (Decoding of some sort? Is this an exclusively QBASIC function?) AND What is the CVI() function?
A4) I have no idea if QB is the only language that has the CVL( ) and CVI( ) functions because QB is the only language I know. However the deal is that QB can store numberic values in a compressed format. This serves two functions. First all the numbers of the same type (interger or single precision, etc.) all can be stored in the same length string (all intergers in 2 bytes, all long intergers in 4 bytes, etc.) which is really useful in random access files. The second function is that the numbers are much smaller to store. Remember that I come from a time before 100 gigabyte hard drives when a 360k floppy drive was the most you could hope for in storage. But anyway, following is some code that will replace the CVL( ) and CVI( ) commands.

CVL( )
A$ Is the number you are trying to convert.

X = 0
FOR A = 1 TO 4
E = ASC(MID$(A$, A, 1))
G = 256 ^ (A - 1)
X = X + E * G
NEXT A

CVI( )
A$ Is the number you are trying to convert.

X = 0
FOR A = 1 TO 2
E = ASC(MID$(A$, A, 1))
G = 256 ^ (A - 1)
X = X + E * G
NEXT A

Q5) What are the possible values for decimal/no decimal and what does each case mean?
A5) NOD can equal either 1 or 100. 100 means that there are no decimals displayed in numeric values. 1 means that decimals are displayed. This is only a concern with Net, Tax, and Total because values in records #1 and #2 are are handled by the POS program. The values that will be returned from Net, Tax, and Total will not have decimals when decoded by the program code above so to properly display the values this code is used.

PRINT USING "#####.##"; A / 100 * NOD

Q6) What is the "UP" value used for?
A6) When UP = 1 it means that the Net, Tax, and Total has been updated and should be redisplayed. Your program must reset the value of UP to zero in the POLE.DAT file.

Posted: Tue Jan 31, 2006 11:15 pm
by balloonbuffoon
Thank you! Hopefully now I'll get some time to work on the program!

--Steve