![]() | ||
Introduction Instantiation Events & Event Handlers Global Methods & Properties | ||
LINKS | ||
| ||||||||||||||||||||||||||||||||||||||||
BOOKS REALbasic The Definitive Guide, Second Edition (2001), by Matt Neuburg. O'Reilly & Associates Inc. 700 pages. ISBN 0-59600117-0 Available form Amazon.co.uk for £12.00 (Second hand only but in fact new). I can strongly recommend this book for beginners. It complements the RB manual excellently. Its first 468 pages are a thorough tour of all the basic features of REALbasic which is very easy for beginners to read and understand. It covers, for example, Fundamentals including the BASIC language, Objects and Classes, Data Types and the User Interface including Controls, with many small items of code to demonstrate techniques, with explanations. The remaining 230 pages go into additional areas that the beginner will probably not want to get involved in at first but which will later become a gold mine. A great strength is its explanation of how RB works. The whole book can be used as a Reference, and it is easy enough to read and is logically set out so it can also be read from cover to cover. It is both practical and provides information which makes it easy for the reader to understand the principles. It is slightly out of date but that does not detract from it significantly. I understand that there is no plan to produce a third edition. REALbasic For Macintosh (one of the Visual Quickstart Guide series), by Michael Swaine. Peachpit Press. 395 pages. No publication date but the copyright date is 2003. ISBN 0-201-78122-0 For REALbasic 3.5 to 5. The V Q Guide for Adobe InDesign is based throughout on a successful task-based formula, consisting of a large number of short snappy individual mini-sections about a half to a page in length describing clearly and effectively how to do just about anything after finding the required task in the index. Each mini-section stands on its own without the need to refer to any other part, and it was on the strength of that formula that I bought the version for RB. However, that depends much more on two tutorials covering 60 pages and when the reader finds a task that he wants to learn about in the index he sometimes finds it embedded in one of the tutorials which requires reading several pages, some not relevant to the task being consulted, to get the particular instructions he wants. There is a wealth of tutorials in the REAL Software's RB package and on the Internet and a VQS guide structured like the one for InDesign would have been a very valuable counterpart to those. I therefore found it at first slightly less helpful than I expected although perhaps computer programming is less suited to a task-based formula. However, it has some useful practical sections on working with files, pictures, animations, movies, databases, communications and scripting which follow the VQS task-based formula. It also has a useful chapter about programming strategy. Quite a useful book which complements "The Definitive Guide" to some extent. Not many manuals or books actually define terms used. I find definitions useful and the following is my collection of terms that I have met, described for the beginner. App Class The Application Class (or more correctly, an Instance of it) is Instantiated when your application starts and remains until it quits. It is empty in the sense that there is no Code in it. Beginners need not know more than the following: It is the place to create and store things - Constants, Methods and Properties (Variables) - that you want to be available to ("seen" by) all code in all parts of your program (remembering that an item created in the Source Code of a window is not available outside that Source Code. See Scope). Examples are Properties acting as Variables such as a counter, or a general purpose Method such as the Wait Method or the WindowArea Function. When Calling an item in the App Class when the Call itself is not in the App Class, you must preface its Call with "App.", as in "App.PopulationCounter" so that RB knows where to look for it. Assign Make the Value of a Variable, Constant or Property equal to a certain quantity. As in Window1.Width = 250; Counter = Counter + 1, FoundWord = "Aardvark"; Available = WindowArea(Window3 (where WindowArea() is a Function). The Value Assigned must be of the same Data Type as that specified when the Instance of the Variable, Constant or Property is Declared (created). Boolean (number) See Data Type. Call The inclusion, in a block of code, of the name of a Method which causes that code to divert execution to that Method. When execution of the code in that Method is complete, execution Returns and continues at the line immediately after the Call. A Function can also be Called but it must be immediately preceded by a word that is capable of having Assigned to it the same Data Type as the Value being Returned by the Function. Examples of Calls are:
Class A hierarchical category of objects with the term "Class" near the top. An Object lower down the hierarchy has the same Properties and Events as the SuperClass to which it belongs, which means that it might have some additional Properties and Events special to that Class. For example, the PushButton Control inherits Properties and Events from its SuperClass - RectControl. From the RB Language Reference can be discovered a hierarchy of Classes (the following does not include all the Classes): Compile The process of converting your Project into the language that the host computer's operating system will understand (consisting of numbers which is all that computers can understand deep down). It creates a stand-alone Application (one that can be run without REALbasic being present Choose File > Build Application). RB also Compiles your Project when you run it in the debugger (Debug > Run) so that you can quickly see how it will perform. The process of Compiling will check for errors but Run-Time Errors will only appear when the application is run. Constant Like a Variable but once Declared it can't be changed in code. Its Data Type can be only a number, String or Boolean. Used for storing Data which must not be changed in code, like the year of the Norman Conquest (1066), Pi (3.1417), a list of the names of the planets ("Mars,Venus,Earth,Jupiter,Saturn ...") Control Any Object contained in the Controls Palette. You drag them from there on to an open window of your Project. Examples are: Pushbutton, EditField, Check Box, Timer. Most Controls provide the interface between the user and the application but some do not and therefore do not appear when the Project is Compiled. Examples of these are: Timer and Noteplayer. A Control has several Events associated with it such as 'MouseDown", "ValueChanged". Data Type The different Types of Data. These are:
Declaration As a verb ("Declare"), the act of writing the details of a Constant, Property or Method such as its name and its Data Type. As a noun, the above details. I have found that when used in connection with a Method, its meaning is sometimes confined to the first line, eg., Sub XYZ() As <Data Type>, or Function XYZ() As <Data Type>, excluding the code which follows it. Double (number) See Data Type. Default Window The window which opens immediately the application launches. If there is more than one window, you can specify which one will be the default by choosing Edit > Project Settings. Event Please see the page Events & Event Handlers. (For "Event Handler" see also Method) False A Value (one of only two) that can be Assigned to a Boolean Property or Variable. Opposite of "True". See Data Type. Function See Method. Global Opposite of "Local". A Constant, Method or Property (Variable) is Global in Scope if it is available (can be Referred to) by all code in the Project or application, provided that when it is Declared its Scope is Set to "Public". See also App Class. IDE "Integrated Development Environment". You are "in the IDE" when you see the Project Window on the screen and can open Source Code windows. At this stage your work is called "The Project". This is the environment where you create Controls, Windows, Menus, Event Handlers, Methods and other computer code written in RB's version of the BASIC language. When you later Build your Project and launch (run) the resulting application, you are no longer in the IDE. Initialise To Assign a Value to a Constant or Property (Variable) at some beginning stage such as when the application is launched or a Method is first executed. Instance or Instantiate See Instantiation. Integer See Data Type. Local Opposite of Global. A Constant, Method or Property (Variable) is Local in Scope if it is available to (can be Referred to by) code in the same Source Code and nowhere else. Message Please see the page on this site called Messages. I found the definition of this word elusive as experts seem to use it and also other terms (Subroutine or Procedure) to refer to what seem to me to be Methods. In your progress with RB, keep the following definitions in mind and reach your own conclusions:
Parameter Depending on their Declaration, some Methods must be accompanied, within the code Calling them, by one or more items of data to allow them to do what you want. These items are called Parameters. The expression used is "passing a Parameter". For example, in a Method (it could be one built-in to RB or perhaps one that you have created):
Project See IDE. 1. A feature of a Control, a window and several other Objects; or 2. It can "stand-alone" acting as a Variable. 1. When acting as a Property it can be viewed and changed by you in the Properties Window (Window > Show Properties) or by code. In this piece of code: EditField1.Text = "Hello", "Text" is a Property of the Control Object "EditField1", and the Value of the data that you enter into the Properties Window ("Hello") appear in EditField1. When you are satisfied with the Values of the properties as shown in the Properties Window and Compile your application, the application uses these Values as Starting Values because the application uses them when starting to run. However, code can change them during the running of the application. 2. Properties can be created by you to act as Variables to store data used by your running application (although RB knows them as Properties). For example a Property called Counter could allow your code to keep track of how many times something has been done. Look here to find out how to create a Property. Be sure to understand Assignment and Data Types. Reference/Refer Means to include the name of an object or Constant, Method or Property (Variable) in some code with the result that it will be processed in a way determined by its Declaration or nature and by the code which Refers to it. Eg., "Window1.Left = 34" contains a Reference to Window1 and to a Property called "Left" (a Property that applies to many objects but in this case Refers only to the Left Property of Window1.)
Run-tme Error An error produced by RB when the application has been executed (as distinct from a Compile error produced during Compilation which often results from a syntax mistake). An example of a Run-Time Error is if during the running of the application a variable (say, X) became zero, perhaps after some time and after the user had exercised a lot of the features of the application. Then the application's code encountered a calculation like Y/X. A "Division by zero" error would occur. That could not be caught during the Compiling of the Project because the value of X during the whole running of the application would not be knowable. Scalar See Data Type. Scope Applies to a Constant, Method or Property (Variable). Please see Global and Local. Set Short for "Assign a Value to a Constant or to a Property (Variable)" As in "Set the window's "Left" Property to 200 pixels". Single (number) See Data Type String See Data Type. Subroutine See Method. True A Value (one of only two) that can be Assigned to a Property, Variable or used as a Parameter, which is of the Data Type "Boolean". The opposite of "False". See Data Type. Value The quantity of a Datum (an item of Data) in the form of one of the allowed Data Types which has been Assigned to a Property (Variable) or Constant, or used as a Parameter, or is Returned by a Function. Eg., Window1.Left = 250. "250" has now become the Value of the Left Property. Variable A place, with a name which can be Referred to, to store data whose Value must be able to be changed during the running of your Project or application. Opposite of a Constant. See also App Class and Property. | ||
Introduction Instantiation Events & Event Handlers Global Methods & Properties | ||