Definitely no problem. Tab alias Chr(9) is the only delimiter, much easier and safer than that "crappy, old", "csv" format.Gablea wrote:Is it is tab spaced does that mean if a field has a comer in it it would not crash the system when it read it in?
Where have I gone wrong
Re: Where have I gone wrong
Re: Where have I gone wrong
Thsts good and From what a reading I should be able to save it back to the databse in a format the tills can would work.
I think I may go with this for my data files :)
Just have to work out how to stop the tills from reading the file if I’m updating it on the back office
I think I may go with this for my data files :)
Just have to work out how to stop the tills from reading the file if I’m updating it on the back office
Re: Where have I gone wrong
@jj2007
Just wanted to make sure this will work on a DOS machine (as I am sure i seen I need to include a Windows.bi file)
I keep getting network error when I try to download the GuiTableControl.zip
Do i need to see that to create the database files? (i am now trying to integrate your code into the KPoS application)
Just wanted to make sure this will work on a DOS machine (as I am sure i seen I need to include a Windows.bi file)
I keep getting network error when I try to download the GuiTableControl.zip
Do i need to see that to create the database files? (i am now trying to integrate your code into the KPoS application)
Re: Where have I gone wrong
Try this link. When right-clicking into the spreadsheet, the last option is "Save database".
Re: Where have I gone wrong
I would try that link but my antivirus keep marking your downloads as viruses
Re: Where have I gone wrong
Try to run it into a privileged folder (marked on your antivirus as 'excluded'); the one where you run your FB code will do.Gablea wrote:I would try that link but my antivirus keep marking your downloads as viruses
Last edited by paul doe on Sep 29, 2018 22:56, edited 1 time in total.
Re: Where have I gone wrong
Try Paul's advice to exclude a specified folder. Sorry for that, it is a frequent problem with exes that do not follow common C/C++ coding patterns. Assembly is powerful but often a little bit different, and some AV are not able to understand that. What I upload is freshly built and absolutely clean.Gablea wrote:I would try that link but my antivirus keep marking your downloads as viruses
Re: Where have I gone wrong
Virustotal.com: Judged clean by most scanners, some exceptions (at top):
I was not afraid to download, the chance that jj2007 makes a virus for linux is low :-)
I hope you don't mind that VirusTotal.com now has a copy of your file.
Code: Select all
ALYac
Gen:Variant.Razy.309337
Arcabit
Trojan.Razy.D4B859
BitDefender
Gen:Variant.Razy.309337
Emsisoft
Gen:Variant.Razy.309337 (B)
eScan
Gen:Variant.Razy.309337
F-Secure
Gen:Variant.Razy.309337
GData
Gen:Variant.Razy.309337
MAX
malware (ai score=83)
McAfee-GW-Edition
BehavesLike.Stymic.lc
Ad-Aware
Clean
AegisLab
Clean
AhnLab-V3
Clean
Alibaba
Clean
Antiy-AVL
Clean
Avast
Clean
Avast Mobile Security
Clean
AVG
Clean
Avira
Clean
AVware
Clean
Babable
Clean
Baidu
Clean
Bkav
Clean
CAT-QuickHeal
Clean
ClamAV
Clean
CMC
Clean
Comodo
Clean
Cylance
Clean
Cyren
Clean
DrWeb
Clean
ESET-NOD32
Clean
F-Prot
Clean
Fortinet
Clean
Ikarus
Clean
Jiangmin
Clean
K7AntiVirus
Clean
K7GW
Clean
Kaspersky
Clean
Kingsoft
Clean
Malwarebytes
Clean
McAfee
Clean
Microsoft
Clean
NANO-Antivirus
Clean
Panda
Clean
Qihoo-360
Clean
Rising
Clean
Sophos AV
Clean
Sophos ML
Clean
SUPERAntiSpyware
Clean
Symantec
Clean
TACHYON
Clean
Tencent
Clean
TheHacker
Clean
TrendMicro
Clean
TrendMicro-HouseCall
Clean
VBA32
Clean
VIPRE
Clean
ViRobot
Clean
Yandex
Clean
Zillya
Clean
ZoneAlarm
Clean
Zoner
Clean
CrowdStrike Falcon
Unable to process file type
Cybereason
Unable to process file type
eGambit
Unable to process file type
Endgame
Unable to process file type
Palo Alto Networks
Unable to process file type
SentinelOne
Unable to process file type
Symantec Mobile Insight
Unable to process file type
Trustlook
Unable to process file type
Webroot
Unable to process file type
I hope you don't mind that VirusTotal.com now has a copy of your file.
Re: Where have I gone wrong
No problem, lolbadidea wrote:Virustotal.com: Judged clean by most scanners, some exceptions (at top):
...
I was not afraid to download, the chance that jj2007 makes a virus for linux is low :-)
I hope you don't mind that VirusTotal.com now has a copy of your file.
As long as the "real" ones like Symantec, Kaspersky, McAfee, Malwarebytes give me a green light, it's ok. We even have a dedicated sub-forum called "AV Software sh*t list". Many programmers say "give your exe a proper manifest, and the AV will keep quiet". That's a great idea, if I was a virus writer, I would give my malware a proper manifest, simple, isn't it? But I digress...
@Gablea: I uploaded a new version here, unzip both files to a folder and drag the Products.tab over GuiTableControl.exe
Try Ctrl F, just for fun. The new version fixes a bug in the translation from csv to tab. Gablea has records like ...
Code: Select all
5025301439101,"BENROSS 9"FAN",0004,0,-,S,1599,A,0,-,0,-,0,0,0,-,0,-,0,0,0,0
Code: Select all
"1569","WB Staff estimates. Cambodia Poverty Assessment 2013 "Where Have All The Poor Gone?", May 2013. Cambodia Socio-Economic Survey 2009.","Next_column_JJ"
Re: Where have I gone wrong
hi All,
I hope you are all well
I have been trying for the last few days to work out how I can add jj2007 code but I can not get my brain to work
What would I put into a global file (accessed by any part of the program) I would assume the function int would be a global one
Is there any that is given JUST for a given data file? I have not done much work on the Linux version as I have been busy working on the Windows version of the PoS application (mainly because I have customer running it)
jj2007 if you could guide me how to integrate this into the PoS app i would be most grateful
I hope you are all well
I have been trying for the last few days to work out how I can add jj2007 code but I can not get my brain to work
What would I put into a global file (accessed by any part of the program) I would assume the function int would be a global one
Is there any that is given JUST for a given data file? I have not done much work on the Linux version as I have been busy working on the Windows version of the PoS application (mainly because I have customer running it)
jj2007 if you could guide me how to integrate this into the PoS app i would be most grateful
Re: Where have I gone wrong
To do this you need classes, not functions. How much do you know about object-oriented programming? It is possible to do this, but it's fairly advanced stuff. You can't simply have 'a function to rule them all', simply because the data structure for each file is different. So, reading and writing them is bound to change, but you can encapsulate this and use another class to perform transparent loading/saving of files through a common interface.Gablea wrote:...
I'm still trying to work out how I could make a universal function that would work will all the data files that my systems uses they are listed below
...
Re: Where have I gone wrong
Show me what you have so far, tomorrow I may have some spare time.Gablea wrote:jj2007 if you could guide me how to integrate this into the PoS app i would be most grateful
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: Where have I gone wrong
I fully agree. In addition to it it's much easier to handle. You only need 2 simple SUBs to read and save any of the data files. Element (0) of the array holds the field names, while the others contain the records as an array of strings. And it even tolerates the faults in jj2007's "Products.tab" file (yes, there are some :-) ).jj2007 wrote:Definitely no problem. Tab alias Chr(9) is the only delimiter, much easier and safer than that "crappy, old", "csv" format.Gablea wrote:Is it is tab spaced does that mean if a field has a comer in it it would not crash the system when it read it in?
Code: Select all
Type tRecord
As String fieldContent(Any)
End Type
ReDim As tRecord products(0)
Sub loadDataFile(fileName As String, array() As tRecord)
Dim As String g
Dim As Integer x, y, b, e, count, ff
ReDim array(0)
ff = FreeFile
Open fileName For Input As #ff
Line Input #ff, g 'get field name string
'get number of fields
For x = 0 To Len(g) - 1
If g[x] = 9 Then
count += 1
EndIf
Next
With array(0) 'array(0) holds the field names
ReDim .fieldContent(count) 'redim field name array
'parse field names string to fieldContent of array(0)
x = 0
For e = 0 To Len(g) - 1
If g[e] = 9 Then
.fieldContent(x) = Mid(g, b + 1, e - b)
b = e + 1
x += 1
EndIf
Next
.fieldContent(x) = Mid(g, b + 1) 'get last field name (terminated by CR/LF)
End With
count = 1
Do Until Eof(ff)
ReDim Preserve array(count)
With array(count)
ReDim .fieldContent(LBound(array(0).fieldContent) To UBound(array(0).fieldContent))
Line Input #ff, g 'get record
'parse record to field content array
x = 0
b = 0
For e = 0 To Len(g) - 1
If g[e] = 9 Then
.fieldContent(x) = Mid(g, b + 1, e - b)
'? array(0).fieldContent(x);" ";.fieldContent(x);Tab(50);b;" ";e;" ";Len(g)
b = e + 1
x += 1
EndIf
Next
.fieldContent(x) = Mid(g, b + 1) 'get last field content
'? array(0).fieldContent(x);" ";.fieldContent(x);Tab(50);b;" ";e;" ";Len(g)
count += 1
End With
'?
'Sleep
Loop
Close ff
End Sub
Sub saveDataFile(fileName As String, array() As tRecord)
Dim As Integer ff, x, y
ff = FreeFile
Open fileName For Output As #ff
For x = LBound(array) To UBound(array)
With array(x)
For y = LBound(.fieldContent) To UBound(.fieldContent) - 1
Print #ff, .fieldContent(y);Chr(9);
'Print array(0).fieldContent(y);" ";.fieldContent(y);"*"
Next
Print #ff, .fieldContent(UBound(.fieldContent))
'Print array(0).fieldContent(UBound(.fieldContent));" ";.fieldContent(UBound(.fieldContent));"*"
End With
'?
'Sleep
Next
Close ff
End Sub
loadDataFile(ExePath + "\KPoS\TableControlV2\Products.tab", products())
saveDataFile(ExePath + "\KPoS\TableControlV2\Products2.tab", products())
'printout array
For y As Integer = 1 To UBound(products)
With products(y)
For x As Integer = LBound(products(0).fieldContent) To UBound(products(0).fieldContent)
? x;" ";products(0).fieldContent(x);Tab(35); .fieldContent(x)
Next
End With
?
Sleep
Next
? UBound(products)
?"OK"
Sleep
End
Re: Where have I gone wrong
@Grindstone
Thanks for the code I shall have a read and test and let you know how it performs
@Paul Doe
I do not know much about oop as I’m use to using Visual Basic and even in that I access the database of MySQL directly. FreeBASIC is a lot to learn
Thanks for the code I shall have a read and test and let you know how it performs
@Paul Doe
I do not know much about oop as I’m use to using Visual Basic and even in that I access the database of MySQL directly. FreeBASIC is a lot to learn
Re: Where have I gone wrong
jj2007 wrote:Show me what you have so far, tomorrow I may have some spare time.Gablea wrote:jj2007 if you could guide me how to integrate this into the PoS app i would be most grateful
hi jj2007 to be honest i do not have anything to show you i have changed some of my code that handles csv but that is it I have not a clue how I would even start to integrated your tab to Data file coding
I can send you the KPoS code (uses the same database functions as my other apps but is not as developed for use with the PoS hardware so it is not as dependent on the hardware to be present)
I just hope I can at some point get my head around this. I understand your code (as it just want I am looking for to convert tab data files into records that the PoS can use and store in memory or on the hard drive (in memory would be good as most of the PoS terminals have 512MB RAM and at least a 600MHz CPU)
Its just understanding that transition from CSV format to your format (and your format is a much better format anyway more forgiving then what csv is)
the dream for my software is to DUMP The Windows Operating system from the Front end machines (PoS terminals) fully and use a true linux system on the front of the stores (still need to work out how I can talk to a IP/TCP Socket device from FreeBASIC)