Opportunity to make some Cash

General FreeBASIC programming questions.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Opportunity to make some Cash

Post by caseih »

I'm not sure running two different windows is going to provide the experience that Gablea is looking for. I think what he has to do is build his own event handling function and in there when there's no events from keyboard or mouse or scanner, run the refresh code to update the clock and other parts of the screen.

This is really where a proper event-driven GUI framework is handy. Things like clock displays happen all by themselves for the most part. I just wish we had Qt bindings for FB, but that's unlikely to happen.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Opportunity to make some Cash

Post by dodicat »

I had seven floppy disks for an old dos Epos system.

There were about a dozen executable files within them.

If Gablea can get a result with my code in Linux, I can improve on it, for instance, get focus immediately on the running pos bit.
Also the actual container box could be an image or a bitmap.
I don't have Linux, so I have no clue if shell works on it.

Keeping everything simple maybe could prove fruitful.
Gablea is using a data base and a font system already.
Getting the time and date to show surely should be the easiest bit of all.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Opportunity to make some Cash

Post by BasicCoder2 »

dodicat wrote:Gablea is using a data base and a font system already.
But is he using the sql data base with FreeBasic program? It is for me the hard part.

If so I would like to know how he has interfaced mysql with a freebasic program.

When I tried to run the example that came with the FB download I got the error message:
LIBMYSQL.DLL is missing.
All I could find in the FB download was libmySQL.dll.a
Don't know what the .a means

I have been looking at some VB examples and it appears that you still have to set up your GUI interface.

.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: Opportunity to make some Cash

Post by Gablea »

@dodicat
I am using a BMP image for the background so that is easy :)

If I can get the time and date to work without having to refresh it inside the main loop that should improve things somewhat

I am more then happy to share with you the code I have so far maybe a fresh set of eyes can recommend ways I can improve the system

@basiccoder2
the database at the moment is csv files but Ideal I would love to move it to a full MySQL interface but I think because of the way I have designed the
code it doesn't work right (the same code I use with in the VB app works perfectly)

I have some sample code that I managed to get working a while ago with a MySQL database I am more then happy to share that with you if you want to see it
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: Opportunity to make some Cash

Post by Gablea »

dodicat wrote:I had seven floppy disks for an old dos Epos system.
I Would have loved to seen that EPoS app (I love old DOS EPoS systems)
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Opportunity to make some Cash

Post by dodicat »

Gablea.
Did you get the date - time code to work on Linux??
The bash shell commands are very different.
https://ss64.com/bash/
I think ./ starts a file.
You should probably put the shell command inside StartPoSMode.
Can you stop the fbtime executable from inside the sub StartPoSMode, as in windows?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Opportunity to make some Cash

Post by MrSwiss »

@BasicCoder2,
BasicCoder2 wrote:Don't know what the .a means.
*.dll.a (export library, of a dynamic lib) -- you need (to download) the *.dll also!
*.a (library itself, for static linking)

I'm not surprised, since you are using, just about every library, available to FB coders. ;-))
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Opportunity to make some Cash

Post by dodicat »

I found those floppys Gablea.
Alphameric Epos I think.
I'll have to look at them on my old machine which has a floppy drive.
If they work I could send them on to you.
I don't know the password though!
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Opportunity to make some Cash

Post by BasicCoder2 »

MrSwiss wrote: -- you need (to download) the *.dll also!
*.a (library itself, for static linking)
Yes there is so much technical stuff I never had to know back in ye old c64 days :)
FreeBasic began as a beginners programming language but evolved into a professional language with some basic syntax.
Like installing a library in code:blocks for C++ if you don't know how to join the dots, even after mindlessly following instructions, you are left out of the game. No simple beginner import sql command.
After downloading the correct .dll the FB sql example works but of course does nothing because I haven't installed mysql.
.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Opportunity to make some Cash

Post by BasicCoder2 »

Gablea wrote:@basiccoder2
the database at the moment is csv files but Ideal I would love to move it to a full MySQL interface but I think because of the way I have designed the
code it doesn't work right (the same code I use with in the VB app works perfectly)
I have some sample code that I managed to get working a while ago with a MySQL database I am more then happy to share that with you if you want to see it
Well I am more comfortable with the csv files which I understand to be plain text data separated by a comma where I would have to write my own query language for then at least it would be integrated and understandable to me.
I assume that was the example product.dat file you had with a downloadable version of your current fb simplePos.bas example.

However if the sql example code can be posted on the forum I think other beginners would also be interested as there isn't any sql with FB tutorial.
.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Opportunity to make some Cash

Post by MrSwiss »

BasicCoder2 wrote:... also be interested as there isn't any sql with FB tutorial.
That is simply, because SQL, is a language of it's own (tructured [Q]uery [L]anguage).
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Opportunity to make some Cash

Post by BasicCoder2 »

MrSwiss wrote:
BasicCoder2 wrote:... also be interested as there isn't any sql with FB tutorial.
That is simply, because SQL, is a language of it's own (tructured [Q]uery [L]anguage).

What I meant was there is no MySQL FreeBasic API programming tutorial.
http://zetcode.com/db/mysqlc/
A beginner tutorial would include a test database program with test data.

Ok so you do need a separate data base. I forget which one Gablea is using.

I would probably find it easier to write my own integrated database program although there would be an issue when sharing data with other another data base.
.
Last edited by BasicCoder2 on Jul 05, 2017 5:40, edited 1 time in total.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Opportunity to make some Cash

Post by MrSwiss »

BasicCoder2 wrote:So does this mean the "language" is separate from the actual data base? -- no, separate to FB (or C ...)
Can you have any database and if so how does the data base itself have to connect to the mysql.dll thingy? -- no, client-application only
database <-> sql language <-> freebasic (or c or whatever) program -- correct
What I meant was there is no MySQL FreeBasic API programming tutorial. -- no, the dll provides the API (dll tutorial needed)
SQL is a Standard (supported by most DB manufacturers, commercial and free),
you are not advised to invent something own! (a really bad idea, for many reasons)

I'll only give you the most obvious one:
every DB programmer (worldwide) will hate you, for doing that (it's the main reason, for Standards!)

Btw: Gablea is using MySQL ... (free, open source *RDBMS).

*RDBMS = relational data base management system, sometimes called DBE, data base engine
(usually installed on a server, but local is also possible)
The name "client <--> server system", is describing DB's appropriately.
vdecampo
Posts: 2992
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Re: Opportunity to make some Cash

Post by vdecampo »

MrSwiss wrote:@Vince,

it isn't exactly helpful, to compare a relatively new SOC (R-Pi), with "stone-age" PC-HW ...
(as comparing Apples and Bananas, while both are "fruit's")
I guess the real question is, why not just replace the stone-age PC-HW with a $35 Raspberry pi?

-V
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Opportunity to make some Cash

Post by St_W »

dodicat wrote: and here is your pos code using the fbtime.exe

Code: Select all

[...]
shell "start fbtime.exe" 
[...]
      shell "taskkill /F /IM fbtime.exe"
      [...]
does it work in Linux?
No, it won't as such, as "taskkill" and "start" do not exist or work differently on Linux and executables do not have an ".exe" suffix.
Post Reply