mwieder wrote:There's unfortunately nothing built-in to handle the Customer.Bills type of OOP - you'll have to write your own library routines for this. I do this sort of disambiguation with things like
set the itemDelimiter to "."
and then parse my way down the string. The lack of user-defined structures is also a pain.
Hi, thanks for your answer.
I'm not talking about write Customer.Bills as is. I ask for the best way to reuse code, because an ERP (with POS, store, stocks, sells, shopping, logistics, production and so on..) is a big project, and I need to know, what is the right way, to centralize code in some place, to reuse in all the application.
In a Customer form (card, stack, I don' know what is the right name here), with a "purchase invoices" tab for example, I need to show a datagrid with the customer's purchase invoices for example, but I don't want to build the SQL from there, because I will need the same information to get this data in other place of the application, and If something changes, I need to mdify in more than one script.
For this reason, I ask what is the right way to reuse code in Livecode, and
I was thinking that the function could query a database, do some processing, and return formatted data suitable for direct insertion into your datagrid. If the data set is not too large, you can certainly keep the data inside a stack. I do this with data sets up to 5000 records, and have no issues. Many on this list are adamant about using databases as opposed to internal stack based record holders. They may be right.
Could be very suitable in some projects, but an ERP could manage a lot of data from various years, 5000 product references, or Invoices, Quotes and so on, is not enough, and this app will work in a multiuser enviroment.
Probably, I don't ask correctly what I looking for in my first question.
In my previous message I wrote:
You are talking about a Stack working as library, for example (a Customer stack maybe?), and inside, functions for customers, to do something like.
put customerBills(customerID) into dataGrid "CustomerBills"
I uderstood you correctly?
This is the way to go? Or there are something better to do what I need? There are something like .bas modules containing only code in LiveCode?