Page 1 of 1

[Dropped] Good language reference for basic language as used in Base

Posted: Mon May 16, 2011 3:52 pm
by GPS
[Closed but not Solved] I'm new to Open Office Base. Have figured out how to make a table and design a form. However I need to go further and add code modules to my database. I have expirience in Basic, Visual Basic and Access programming. I need a language reference that shows examples of how to set up modules. Basic stuff like displaying text in a text box, properties of controls and so on. The help system is too narrow in scope. It does not give a broad enough explanation of a topic. I have downloaded all the documentation I can find but I'm still have not found a good source. Well maybe I need something like Open Office for Dummies. Would you all recomend a good beginners tutorial or manual that I can download?

I'm using version 3.3 and running under Vista.

Thanks for your help.

Re: Good language reference for basic language as used in Ba

Posted: Mon May 16, 2011 4:03 pm
by Villeroy
So you are out of luck. OpenOffice.org is definitively not for "Dummies".

Re: Good language reference for basic language as used in Ba

Posted: Tue May 17, 2011 1:25 am
by malik
well if you haven't found http://wiki.services.openoffice.org/wiki/Main_Page that could be helpful i use it to search for commands in order to get a better feel of the syntax and learn what else a command can do besides how it's used in an example. Also i think (i might be mistaken) there is a VBA plug-in. if not LibreOffice uses VBA. The trade off i think is VBA tutorials / manuals All over the place vs. Community OpenOffice supported Star Basic. I choose the latter. But I'm a far cry from an expert on this that much i do know.

I have suggested that the "Guru's" here write a manual in a 'For Dummies' Format.. But what a time sink and out right boring that would be.
I have all the time in the world but nowhere enough knowledge. I'm still a newbie and cant write my own macro's. I can edit them and change parameters to some extent and do minor debugging sometimes but that's about it.
~Malik

Re: Good language reference for basic language as used in Ba

Posted: Tue May 17, 2011 6:04 pm
by rudolfo
Generally it helps a lot if you have experience in programming databases via interfaces. First of all you need to understand SQL (simple queries, updates, subselects, inner joins, outer joins, grouping and aggregating). For understanding the logic of your statements standard SQL documentation (-> wikipedia) is the best. But for the bits and pieces you have to consult the documentation of the database backend that you are using. For the embedded HSQL database this can be found at http://www.hsqldb.org/doc/guide/ch09.html

The interface used in StarBasic (which is actually the set of "com.sun.star.sdbc" UNO objects) follows very much the JDBC interface of Java: (get)Connection, createStatement(), prepareStatement(), execute(), executeUpdate(), ResultSets and how to navigate through result sets. ODBC and JDBC are not very different, but I don't know about ADO or whatever is used nowerdays in VisualBasic or MS Access for database access.

If you really want to go for programming the API I recommend the two documents at the bottom of the page Roberto Benitez on Programming with Base. Together they give you a good guideline what to implement with the help of forms, filters and subforms and at for which features it is worth to start programming.
Also Andrew Pitonyak has written a useful introduction to Base Programming ... just google for the name.

Re: Good language reference for basic language as used in Ba

Posted: Thu May 19, 2011 8:14 pm
by GPS
Thanks for the suggestions. I will check them out. I've been able to make a table and a form but, I'm unable to get a buttont on the form to run a simple macro (Print "Hello"). I tried attaching the macro to several events on the button. but nothing happens. Tried it on a dialog. Same, nothing happens. Tried compiling no change. If I run the macro from the macro dialog it works. I have enabled macros in Base. I'm using v 3.3 on Win 2000. Hope someone can point me in the right direction. I need to use the click event and to assign text to a text box programaticaly.

Thanks again for taking the time to help!

Re: Good language reference for basic language as used in Ba

Posted: Fri May 20, 2011 1:07 am
by rudolfo
Read the Forms&Dialogs pdf document by Roberto Benitez that I referenced above! There is a section called Form Events with all you need to know.
In general an event handler macro needs a parameter and exactly one parameter which is the event that triggered the macro. You can't run such a macro from the macro dialog, because macros that can be run interactively by the user are not allowed to have parameters.

Re: Good language reference for basic language as used in Ba

Posted: Sat May 21, 2011 1:51 am
by GPS
Thanks, Rudolfo. I finaly found the document you recomended. I'll read it completly over the next few days. Looks like it will answer a lot of questions.

Re: Good language reference for basic language as used in Ba

Posted: Sun May 22, 2011 4:58 pm
by GPS
I have read the Benitez document recomended. It was helpful but it is an incomplete document. The information on the textbox was useful but there was no further information on any other form control. I again looked for documentation on the listbox control but found none. The only thing I found was one statement indicating the lisbox on a form had different properties than on a dialog. There is an indication of a developers macro site but that is a bad link.

How is a beginner to learn about this product if it's developers cannot put together a simple manual. The help system with the progam is less than useless. I would like to use Open Office as an alternative to MS Office. Without reasonable documentation this is not possible. I've spent three days searching the net and have not found anything like the documentation MS provides even for thier free products.

Open Office may be a great product, but i'll never know because of the lack of simple logical documentation. The developers should put as much time into developing the documentation as in developing the program.

Re: Good language reference for basic language as used in Ba

Posted: Sun May 22, 2011 9:20 pm
by RPG
Hello

I think what you are searching is not to find. You can find a lot of information about the services and interfaces. But about the idea behind that is real difficult to find information. Only in the programming guide they explain it. When I start with programming in OOo then I skipped that chapter it was for me to difficult. Later when I try to learn more about OOo I succeed to understand it. Maybe I must write: I think I understand it. As far I understand it, it helps me to understand about what they write when they explain part of the API. I think you have also to understand how they built up OOo with all the modules.

One other thing starters have to learn and that is much more easy: how does OOo works. When you understand the normal working of OOo then you can also better understand how you can expand it with macros.

Romke

Re: Good language reference for basic language as used in Ba

Posted: Mon May 23, 2011 7:59 pm
by GPS
Romke,

I have not been able to find one document that logicaly lays out how anything in Open Office works. There is no progressive manual that builds one topic on another. Why not start with creating a table, then a form, then controls etc. Then maybe add a section on controls. One that explains how to use and code the control. Show me by example how to get text from a text box and so on. With those building blocks I can begin to use Base. I can look into how it works as I go along.

I've tried to find the answer to a simle question "How do I return the seleceted item from a list box?". I've looked in the basic guide and found the properties of a listbox but, not how to use them. I've spent four days now looking for the answer and still have not found it. The closest I've come is in Benitez document. When I learned how to drive I asked "How do I start it?". The teacher showed me how to turn the key in about two minutes. Then he went on to releasing the break, putting it in gear..... Well you get the idea. I need to be writing an application not spending days on the net looking for answers.

Hope this gets someone to write such a manual. I'm sure there are many who would benifit.

Re: Good language reference for basic language as used in Ba

Posted: Mon May 23, 2011 8:40 pm
by Villeroy
You create tables and relations with a database program. No, Base is NOT a database program. All the rest is about documents that can be explored using an object inspector. You can find hundreds of examples how to get text from a text box. Most of them simply do not work as expected because nobody wants to write into text boxes actually. The database field is the object to write data into.
"How do I return the seleceted item from a list box?" If you could program anything this would be no question at all. The major problem is that most people are unable to program and start learning in the most complex (und buggy) environent using a totally inadequate language (OOo Basic).

Re: Good language reference for basic language as used in Ba

Posted: Mon May 23, 2011 9:23 pm
by Nocton
I quite understand your frustration, GPS. I had the same sort of problems and questions when I started making a database in OO last year. All I can say is that if you put your problem on the forums in clear way, setting out table, fields, form, what trying to do, etc. you will get lots of help and support. And very quickly too. For example you say:
I've been able to make a table and a form but, I'm unable to get a buttont on the form to run a simple macro (Print "Hello"). I tried attaching the macro to several events on the button. but nothing happens. Tried it on a dialog. Same, nothing happens. Tried compiling no change. If I run the macro from the macro dialog it works.
Well just put the example, with the code in more detail on the Forms forum and I am sure you'll get a quick solution. This forum is a wonderful resource. [If your macro works, then all you need to do is to attach to the 'Mouse button released' event of the button.]

Re: Good language reference for basic language as used in Ba

Posted: Mon May 23, 2011 9:43 pm
by RPG
Hello GPS

I have only one question why do you spent such a long time for a tool what is clearly the wrong tool for you. I do also spent a lot of time with OOo and sometimes I think: maybe I have the wrong tool but I don't complain about OOo. If you can not do those things you want with OOo then search for an other tool. You can ask what kind of tool you can use. I have no idea.

Some thing else you can do is: Use those parts who are good for you and use other tools for those things you can not do with OOo.

I think there comes no tutorials as you want. The way to follow: is study and use OOo without macros. What you not can do with OOo try it to do with other tools. After a time when you really understand OOo then maybe you can think about some little macros.

When you want not follow this idea start with writing macros and start also with the study of all those things you need in this case the BASIC tutorial about BASIC and the API.

Romke

Re: Good language reference for basic language as used in Ba

Posted: Mon May 23, 2011 11:50 pm
by GPS
OK Guys. I appreciate all the replies. In response to Nocton. All I want to do is get the selected item in a listbox on a form into a variable. Simple enough. Well I know I can write database aplications in Visual Basic. All the forms, tables, controls and functions are there. I think Romke is right OO is not the tool to use. I'm going to write off Open Office and put it on the trash basket. There are other packages out there.

Again thanks for all the replies.