Everything else that doesn't fall into one of the other categories.
saboteur
 
Posts: 19
Joined: Mon Jan 08, 2018 10:25 am

PB to SB Conversion Q's

by saboteur Mon Jun 24, 2019 7:33 am

I have an ERP application written in PB and would like to convert it to SB.

In an affort to keep code managable, each option is a individual program ( there are over a hundred ) that is called from a main menu program using RunProgram and this suits my needs admirably.

However, I don't see this being available within SB, so how would i achieve a similar result ?

Obviously, it's heavily dependant on mysql/mariadb read/writes and I assume the way to acheive this is via PHP scripts acting as a go between, but haven't seen many examples of this.

I also rely on the listicongadget, but have to use the webgadget and html tables ( becasue i need variable row heights ) how can this be acheived in SB ?.

I will also need a way to produce printed reports, but understand this lwill probably need some sort of PDF output - has this been tried by anyone ?

Finally, one of my frustrations with PB is tha inability to Format the theme of the window ( Title bar mainly ), is this possible at all in SB ?

Sorry for all the q's, but I'd really like to keep my work in the PB family :mrgreen:

Cheers
the.weavster
 
Posts: 171
Joined: Sat Mar 01, 2014 3:02 pm

Re: PB to SB Conversion Q's

by the.weavster Tue Jun 25, 2019 7:18 am

saboteur wrote:In an affort to keep code managable, each option is a individual program ( there are over a hundred ) that is called from a main menu program using RunProgram and this suits my needs admirably.

However, I don't see this being available within SB, so how would i achieve a similar result ?

You can find an example of breaking event loops down to a window by window basis here

saboteur wrote:Obviously, it's heavily dependant on mysql/mariadb read/writes and I assume the way to acheive this is via PHP scripts acting as a go between, but haven't seen many examples of this.

Why not use PureBasic's CGI commands? I'd recommend JSON-RPC for sending the data back and forth. That also matches your brief of preferring small discrete programs.

saboteur wrote:I also rely on the listicongadget, but have to use the webgadget and html tables ( becasue i need variable row heights ) how can this be acheived in SB ?.
Peter has created a wrapper for Tabulator which you can find here

saboteur wrote:I will also need a way to produce printed reports, but understand this lwill probably need some sort of PDF output - has this been tried by anyone?
I don't know if this is of any interest but you can use Valentina Reports from PureBasic. There's an example here
saboteur
 
Posts: 19
Joined: Mon Jan 08, 2018 10:25 am

Re: PB to SB Conversion Q's

by saboteur Tue Jun 25, 2019 8:09 am

Thanks for the reply and info, it is very helpfull.

the.weavster wrote:
saboteur wrote:In an affort to keep code managable, each option is a individual program ( there are over a hundred ) that is called from a main menu program using RunProgram and this suits my needs admirably.

However, I don't see this being available within SB, so how would i achieve a similar result ?

You can find an example of breaking event loops down to a window by window basis here

I can't understand this part however. Is it not possible to have individual programs that can call each other and pass variables between them in spiderbasic ?

It's not possible for me to merge all my code into one large block, it would be unmaintainable, a nightmare to debug, and a 100,000+ lines of code.

My understanding of this is not clear, but with PHP i could set session variables etc and pass those between scripts, and i'm sure i can knock something similar up storing 'session' variables' in a local db, but wanted to check if this is something SB has built in.

As an aside, is there a write up on deployment of SB programs, the manual is a bit vague imho.

Anyhoo, thanks again.
the.weavster
 
Posts: 171
Joined: Sat Mar 01, 2014 3:02 pm

Re: PB to SB Conversion Q's

by the.weavster Tue Jun 25, 2019 1:58 pm

saboteur wrote:Is it not possible to have individual programs that can call each other and pass variables between them in spiderbasic ?
It's not possible for me to merge all my code into one large block, it would be unmaintainable, a nightmare to debug, and a 100,000+ lines of code.

You can have each individual window and its associated event handlers in separate files so it's not all in one big block.

saboteur wrote:My understanding of this is not clear, but with PHP i could set session variables etc and pass those between scripts, and i'm sure i can knock something similar up storing 'session' variables' in a local db, but wanted to check if this is something SB has built in.

SpiderBasic creates single page web apps so there's very little need for server side session variables beyond maybe just a session token to show a client has logged in successfully.
saboteur
 
Posts: 19
Joined: Mon Jan 08, 2018 10:25 am

Re: PB to SB Conversion Q's

by saboteur Tue Jun 25, 2019 2:34 pm

the.weavster wrote:
saboteur wrote:Is it not possible to have individual programs that can call each other and pass variables between them in spiderbasic ?
It's not possible for me to merge all my code into one large block, it would be unmaintainable, a nightmare to debug, and a 100,000+ lines of code.

You can have each individual window and its associated event handlers in separate files so it's not all in one big block.
.


Again thanks for the reply.

I'm sorry but i still dont understand, do you mean like an (x)include in PB ? or some other method ? do you have an example.

If i can figure this out I think i'll be confident in converting to SB.

Cheers
the.weavster
 
Posts: 171
Joined: Sat Mar 01, 2014 3:02 pm

Re: PB to SB Conversion Q's

by the.weavster Wed Jun 26, 2019 7:33 am

saboteur wrote:I'm sorry but i still dont understand, do you mean like an (x)include in PB ?

On the server side your CGIs could be discrete small programs that take care of a particular task. Client side... I suppose you could have a 'menu' page that is just a set of links to small SpiderBasic apps but personally I think I'd use XIncludeFile to bring all windows together into one app.
Dirk Geppert
 
Posts: 138
Joined: Fri Sep 22, 2017 7:02 am

Re: PB to SB Conversion Q's

by Dirk Geppert Wed Jun 26, 2019 11:38 am

If you want to develop SB and PB in one project, you should take a look at Peter's SpiderByte.

https://github.com/spiderbytes/SpiderBite

II personally work with it, on all my client server projects - it's great!
bbanelli
 
Posts: 102
Joined: Mon Jul 13, 2015 7:40 am

Re: PB to SB Conversion Q's

by bbanelli Fri Aug 09, 2019 9:59 am

I know this is an old topic, but I would strongly discourage using (any, let alone PB's) CGI in 2019.

Instead, for server side, consider GoLang. It is not OO, it is modern but very human readable (like PB), and you can pack whole SB app in it and deploy it on any PaaS/SaaS platform (Heroku, Docker...). If you are accustomed to PB syntax and way of thinking, you will adore Go!

Go's built in HTTP server can serve SB files and handle backend perfectly.
"If you lie to the compiler, it will get its revenge."
Henry Spencer
http://www.pci-z.com/
User avatar
Peter
 
Posts: 650
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: PB to SB Conversion Q's

by Peter Fri Aug 09, 2019 1:09 pm

bbanelli wrote:Instead, for server side, consider GoLang.

Consequently, you would have to use GopherJS or the Joy Compiler now. ;)
the.weavster
 
Posts: 171
Joined: Sat Mar 01, 2014 3:02 pm

Re: PB to SB Conversion Q's

by the.weavster Fri Aug 09, 2019 9:27 pm

bbanelli wrote:I know this is an old topic, but I would strongly discourage using (any, let alone PB's) CGI in 2019.


Why? CGI is wonderfully simple and simple solutions are invariably the most robust.
Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest