Beginning Realbasic from Novice to Professional

Total Page:16

File Type:pdf, Size:1020Kb

Beginning Realbasic from Novice to Professional Beginning REALbasic From Novice to Professional ■■■ Jerry Lee Ford, Jr. Beginning REALbasic: From Novice to Professional Copyright © 2006 by Jerry Lee Ford, Jr. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-59059-634-0 ISBN-10 (pbk): 1-59059-634-X Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Chris Mills Technical Reviewer: Allan Kent Editorial Board: Steve Anglin, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Gennick, Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser, Keir Thomas, Matt Wade Project Manager: Richard Dal Porto Copy Edit Manager: Nicole LeClerc Copy Editor: Marcia Baker Assistant Production Director: Kari Brooks-Copony Production Editor: Lori Bring Compositor: Pat Christenson Proofreader: Linda Seifert Indexer: Broccoli Information Management Artist: April Milne Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://www.apress.com. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available on the accompanying CD. Any corrections to code and errata are posted for download/viewing at http://www.apress.com. Just search for the book by title, author, or ISBN, in the search bar on our homepage. To Alexander, William, Molly, and Mary. Contents at a Glance About the Author . xix About the Technical Reviewer. .xx Acknowledgments. xxi Introduction . xxii PART 1 ■ ■ ■ Introducing REALbasic ■CHAPTER 1 An Introduction to REALbasic . 3 ■CHAPTER 2 Navigating the REALbasic Integrated Development Environment . 35 PART 2 ■ ■ ■ Learning How to Program with REALbasic ■CHAPTER 3 Creating an Application’s User Interface . 67 ■CHAPTER 4 Working with REALbasic Menus. 103 ■CHAPTER 5 Storing and Retrieving Application Data . 135 ■CHAPTER 6 Making Decisions with Conditional Logic . 163 ■CHAPTER 7 Iterative Processing . 187 ■CHAPTER 8 Object-Oriented Programming . 209 PART 3 ■ ■ ■ Advanced Topics ■CHAPTER 9 Processing Text Files . 243 ■CHAPTER 10 Working with Databases. 273 ■CHAPTER 11 Working with Graphics and Audio . 301 ■CHAPTER 12 Debugging REALbasic Applications. 323 iv PART 4 ■ ■ ■ Appendixes ■APPENDIX A Migrating Visual Basic Projects to REALbasic . 347 ■APPENDIX B What’s on the CD-ROM? . 351 ■APPENDIX C What’s Next? . 353 ■INDEX . 357 v Contents About the Author . xix About the Technical Reviewer. .xx Acknowledgments. xxi Introduction . xxii PART 1 ■ ■ ■ Introducing REALbasic ■CHAPTER 1 An Introduction to REALbasic. 3 Overview of REALbasic . 3 Drag-and-Drop GUI Design . 5 Object-Oriented Programming . 6 RAD . 6 Cross-Platform Application Development . 6 What Can REALbasic Do? . 7 What’s New in REALbasic? . 7 Supported Development Platforms . 8 Supported Execution Platforms. 10 Standard vs. Professional . 10 REALbasic 2006 Standard Edition . 11 REALbasic 2006 Professional Edition . 12 Downloading REALbasic . 13 REALbasic vs. Visual Basic . 14 REALbasic vs. Apple’s XCode . 16 Online REALbasic Support Services . 17 Getting Started with Your First REALbasic Application. 19 Hello World! . 19 Compiling Your Application for Macintosh, Windows, and Linux Execution . 32 Summary . 33 vii viii ■CONTENTS ■CHAPTER 2 Navigating the REALbasic Integrated Development Environment . 35 Starting REALbasic . 35 The REALbasic Menu . 37 REALbasic’s Main Toolbar. 38 Default Main Toolbar Resources. 38 Configuring REALbasic’s Main Toolbar . 38 REALbasic’s Bookmarks Toolbar . 39 Adding New Bookmarks. 40 Editing Your Bookmarks. 40 REALbasic’s Screen Area . 41 Tabs Bar . 41 Editor Toolbar. 42 Screens. 42 REALbasic’s Tips Bar . 51 REALbasic’s Integrated Help Features . 52 Accessing REALbasic’s Manuals . 53 Accessing REALbasic Online Resources . 53 Working with REALbasic’s Electronic Language Reference. 54 Building a Custom Web Browser . 57 The RBBookFinder Browser. 58 Designing the User Interface. 59 Changing Windows and Control Properties . 61 Adding a Little REALbasic Code . 62 Testing Your Application . 63 Summary . 64 PART 2 ■ ■ ■ Learning How to Program with REALbasic ■CHAPTER 3 Creating an Application’s User Interface. 67 Building Application Windows . 67 Document . 69 Movable Modal . ..
Recommended publications
  • Manualgambas.Pdf
    Introducción Este míni-manual esta pensado y orientado para los asistentes al taller de Gambas. Dado que, a priori, esperamos la asistencia de gente sin conocimientos previos de programación este texto va a ser escueto y muy elemental. Además de dar una formación teórica básica tiene el propósito de servir como chuleta para poder consultar las sintaxis más elementales como por ejemplo de las condicionales, bucles, etc. Nuestra herramienta: GAMBAS Vamos a usar Gambas, un lenguaje de programación visual similar al Visual Basic de Microsoft. Gambas dispone de su propio IDE. Un IDE, por sus siglas en inglés, es un entorno de desarrollo integrado. Gambas es lo que se conoce como un lenguaje de programación interpretado y como ocurre con GNU que es un acrónimo recurrente (Gnu No es Unix) Gambas significa Gambas Almost Means BASic, que traducido al castellano es Gambas Casi es BASic. Los IDE's son unos programas que aglutinan todo lo que necesitamos para programar. Tenemos un editor para picar (vamos a ir introduciéndonos en la jerga del programador) código, con resaltado por colores, autocompletado para ayudarnos en la edición, señalización de errores, etc. Un depurador para poder controlar la ejecución del programa y evaluar su comportamiento con sus inspectores de variables, objetos, etc. Un compilador para generar los binarios, bytecodes, ejecutables, etc. Un empaquetador para crear los instaladores. Además disponen de otras herramientas como gestores de servicios SVC para el control de versiones como GIT o similares. Editores de conexión a bases de datos, etc. Lo primero que vemos al ejecutar Gambas la ventana de bienvenida y nos da varias opciones, abrir un proyecto existente, crear uno nuevo o abrir recientes.
    [Show full text]
  • Liste Von Programmiersprachen
    www.sf-ag.com Liste von Programmiersprachen A (1) A (21) AMOS BASIC (2) A# (22) AMPL (3) A+ (23) Angel Script (4) ABAP (24) ANSYS Parametric Design Language (5) Action (25) APL (6) Action Script (26) App Inventor (7) Action Oberon (27) Applied Type System (8) ACUCOBOL (28) Apple Script (9) Ada (29) Arden-Syntax (10) ADbasic (30) ARLA (11) Adenine (31) ASIC (12) Agilent VEE (32) Atlas Transformatikon Language (13) AIMMS (33) Autocoder (14) Aldor (34) Auto Hotkey (15) Alef (35) Autolt (16) Aleph (36) AutoLISP (17) ALGOL (ALGOL 60, ALGOL W, ALGOL 68) (37) Automatically Programmed Tools (APT) (18) Alice (38) Avenue (19) AML (39) awk (awk, gawk, mawk, nawk) (20) Amiga BASIC B (1) B (9) Bean Shell (2) B-0 (10) Befunge (3) BANCStar (11) Beta (Programmiersprache) (4) BASIC, siehe auch Liste der BASIC-Dialekte (12) BLISS (Programmiersprache) (5) Basic Calculator (13) Blitz Basic (6) Batch (14) Boo (7) Bash (15) Brainfuck, Branfuck2D (8) Basic Combined Programming Language (BCPL) Stichworte: Hochsprachenliste Letzte Änderung: 27.07.2016 / TS C:\Users\Goose\Downloads\Softwareentwicklung\Hochsprachenliste.doc Seite 1 von 7 www.sf-ag.com C (1) C (20) Cluster (2) C++ (21) Co-array Fortran (3) C-- (22) COBOL (4) C# (23) Cobra (5) C/AL (24) Coffee Script (6) Caml, siehe Objective CAML (25) COMAL (7) Ceylon (26) Cω (8) C for graphics (27) COMIT (9) Chef (28) Common Lisp (10) CHILL (29) Component Pascal (11) Chuck (Programmiersprache) (30) Comskee (12) CL (31) CONZEPT 16 (13) Clarion (32) CPL (14) Clean (33) CURL (15) Clipper (34) Curry (16) CLIPS (35)
    [Show full text]
  • Contents at a Glance
    02_088702 ftoc.qxp 9/26/06 10:13 PM Page ix Contents at a Glance Introduction .................................................................1 Part I: Programming a Computer....................................7 Chapter 1: Learning Computer Programming for the First Time .................................9 Chapter 2: All about Programming Languages .............................................................19 Chapter 3: How to Write a Program ...............................................................................37 Chapter 4: The Tools of a Computer Programmer.......................................................49 Part II: The Building Blocks of Programming ................63 Chapter 5: Getting Started...............................................................................................65 Chapter 6: The Structure of a Computer Program.......................................................75 Chapter 7: Variables, Constants, and Comments.........................................................91 Chapter 8: Crunching Numbers and Playing with Strings.........................................103 Chapter 9: Making Decisions with Branching Statements ........................................119 Chapter 10: Repeating Yourself with Loops................................................................143 Chapter 11: Dividing a Program into Subprograms ...................................................157 Chapter 12: Storing Stuff in Arrays...............................................................................175 Chapter
    [Show full text]
  • B4X Booklets
    B4X Booklets B4X Getting started Copyright: © 2018 Anywhere Software Edition 1.4 Last update : 2018.11.28 Table of contents 2 B4X Getting started 1 B4X .............................................................................................................................................. 5 2 Getting started B4A..................................................................................................................... 6 2.1 B4A Trial version ................................................................................................................. 7 2.2 Installing B4A and Android SDK ........................................................................................ 8 2.2.1 Installing Java JDK .......................................................................................................... 8 2.2.2 Installing Android SDK ................................................................................................... 9 2.2.3 Installing B4A .................................................................................................................. 9 2.3 B4A Configure Paths in the IDE ........................................................................................ 11 2.4 Installation problem ........................................................................................................... 12 2.5 B4A Choice of the language .............................................................................................. 12 2.6 B4A Connecting a real device...........................................................................................
    [Show full text]
  • Windows Api Examples
    Windows Api Examples Petur J. Skulason. <mailto:[email protected]?subject=Windows Api Examples> http://www.est.is/~pjs/RealBasic/ http://u225.nett.is/~pjs/ All this is free to use in any application (commercial - shareware - freeware). Also to extract examples and post as examples from other websites. (I do not take any responsibility for how good this is, I dont call for any credit mony or anythink else ... ) These are few examples that I have found on lists, and by experimenting with Windows API calls and browsing MSDN website (http://msdn.microsoft.com/ ). Many text’s are copyed from MSDN website in this document are from MSDN website. Examples are tested on Win98 system, HP OmniBook XE2, compiled on PowerBook G3, PPC7300, LC475. Some of examples are working correctly. Most of examples are working, but some are not working, possible that i’am doing somthing wrong, but they are there. Comments, bugs, other samples welcome. Even requests for more samples. I might try to look at it and see if its possible. PS: In this document I have put some links to MSDN webpage’s. If you are running Internet Explorer then you might need to ‘disconnect java script’ couse then ie might show only part of page. Either run ie with *.js ‘OFF’ or use an other browser, like iCab or Netscape. (As of aug 30, 2000 then pages are displayed correct... problem might be solved... ) When declaring functions/subs then one is calling library, like user32.dll . Can omitt the name extension, use like Lib “user32” instead of Lib “user32.dll”.
    [Show full text]
  • Porting VB Applications to Linux and Mac OS X
    Porting VB Applications to Linux and Mac OS X A how-to guide for Visual Basic developers by Hank Marquis Hank Marquis has been using Visual Basic since version 1.0. He is author of A Visual Basic Programmer's Toolkit (APress), The Visual Basic 6.0 Bible (IDG) and over 35 articles published in CTO/BackOffice, Visual Basic Programmer's Journal (VBPJ), Visual Studio Magazine (VSM) and Microsoft MSDN. He is currently CTO of SlayFire Software Co., creating optimization and performance tools for REALbasic. Reach him at [email protected] or www.slayfiresoftware.com. Table of Contents Porting Options Beginning Assumptions Porting Considerations Language Keywords Code Syntax Data Types Language Structure User Interface Project Structure Platform APIs Other Considerations Visual Basic Project Converter Additional Resources Table 1. Porting Considerations Table 2. Visual Basic and REALbasic Datatypes Table 3. Getting Ready: The Step by Step Process Preparing Your Code to Use VB Project Converter © 2004 REAL Software, Inc. and Hank Marquis. All rights reserved. Page 1 of 17 Porting Visual Basic applications to Linux and Mac OS X A how-to guide for Visual Basic developers In this white paper, I'll show how you can preserve your investment in Visual Basic by porting your code to Linux and/or Macintosh using REAL Software's REALbasic. I'll provide some examples, share some experience and give you a roadmap for how to port—and how not to port—your Visual Basic apps cross- platform. My intent is to save you some time and pain. For porting our VB projects, we will use REALbasic 5.5.3 for Windows, a modern software development environment that is quite similar to Microsoft Visual Basic® in terms of the GUI and syntax.
    [Show full text]
  • Visual Basic 2017 Made Easy
    Visual Basic 2017 Made Easy By Dr.Liew 1 Disclaimer Visual Basic 2017 Made Easy is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft Corporation. Trademarks Microsoft, Visual Basic, Excel and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. All other trademarks belong to their respective owners. Liability The purpose of this book is to provide basic guides for people interested in Visual Basic 2017 programming. Although every effort and care has been taken to make The information as accurate as possible, the author shall not be liable for any error, Harm or damage arising from using the instructions given in this book. ​ Copyright ® 2017 Liew Voon Kiong All rights reserved. No Part of this e-book may be reproduced, in any form or by any means, without permission in writing from the author. 2 Acknowledgement I would like to express my sincere gratitude to many people who have made their contributions in one way or another to the successful publication of this book. My special thanks go to my children Xiang, Yi and Xun who have contributed their ideas and help in editing this book. I would also like to appreciate the support provided by my beloved wife Kim Huang and my youngest daughter Yuan. I would also like to thank the millions of readers who have visited my Visual Basic Tutorial website at vbtutor.net for ​ ​ ​ their support and encouragement. About the Author Dr. Liew Voon Kiong holds a bachelor’s degree in Mathematics, a master’s degree in Management and a doctorate in Business Administration.
    [Show full text]
  • Belajar Gambas
    I. BELAJAR GAMBAS Pada pertemuan kali ini kita akan belajar salah satu pemrograman dalam Linux. Ada banyak pemrograman dalam Linux seperti halnya pada Windows, tapi yang akan kita bahas sekarang adalah Gambas. Gambas, Apaan tuh? Boleh dikatakan Gambas adalah Visual basic-Nya Linux. Anda yang telah mengenal Visual Basic di windows pasti akan sangat familiar dengan scrip dalam Gambas, meskipun tidak semua skrip sama. Gambas murni proyek open source di bawah naungan GPL(General Public License). Jadi sifatnya Open source alias Free. Instalasi Gambas Kalau dalam Linux Anda tidak terinstal gambas maka Anda dapat mendownload di URLnya, http://gambas.sourceforge.net. Jika paketnya sudah anda dapatkan maka langkah pertama yang harus dilakukan Adalah dengan perintah : $ tar -xjpvf gambas-xxx.tar.bz2 , atau $tar xzpvf gambas-xxx.tar.gz kemudian lakukan konfigurasi dan instalasi dengan perintah berikut: $cd gambas-xxx $./configure $make $make install tunggu beberapa saat hingga proses selesai. pastikan tidak ada kesalahan pada saat penginstalan. Menjalankan Gambas Untuk menjalankan Gambas dapat dilakukan dengan beberapa cara, bisa melalui konsol atau melalui menu start > gambas. Jika sudah terinstal maka cara berikut bisa Anda lakukan: tekan kombinasi tombol Alt+F2 > ketikan gambas lalu tekan enter, maka jendela kerja gambas akan muncul seprti pada gambar1. Komponen dalam Gambas Ketika menjalankan Gambas, yang pertama muncul adalah jendela selamat datang. pada jendela ini ada beberapa pilihan seperti New project untuk membuat projek baru, Open project untuk membuka projek yang sudah kita buat, Recent project untuk membuka projek yang terakhir kita buka, Exsample untuk melihat contoh -contoh yang telah tersedia. kalau Anda pusing atau gak semangat tinggal quit aja.
    [Show full text]
  • BASIC Programming with Unix Introduction
    LinuxFocus article number 277 http://linuxfocus.org BASIC programming with Unix by John Perr <johnperr(at)Linuxfocus.org> Abstract: About the author: Developing with Linux or another Unix system in BASIC ? Why not ? Linux user since 1994, he is Various free solutions allows us to use the BASIC language to develop one of the French editors of interpreted or compiled applications. LinuxFocus. _________________ _________________ _________________ Translated to English by: Georges Tarbouriech <gt(at)Linuxfocus.org> Introduction Even if it appeared later than other languages on the computing scene, BASIC quickly became widespread on many non Unix systems as a replacement for the scripting languages natively found on Unix. This is probably the main reason why this language is rarely used by Unix people. Unix had a more powerful scripting language from the first day on. Like other scripting languages, BASIC is mostly an interpreted one and uses a rather simple syntax, without data types, apart from a distinction between strings and numbers. Historically, the name of the language comes from its simplicity and from the fact it allows to easily teach programming to students. Unfortunately, the lack of standardization lead to many different versions mostly incompatible with each other. We can even say there are as many versions as interpreters what makes BASIC hardly portable. Despite these drawbacks and many others that the "true programmers" will remind us, BASIC stays an option to be taken into account to quickly develop small programs. This has been especially true for many years because of the Integrated Development Environment found in Windows versions allowing graphical interface design in a few mouse clicks.
    [Show full text]
  • An ECMA-55 Minimal BASIC Compiler for X86-64 Linux®
    Computers 2014, 3, 69-116; doi:10.3390/computers3030069 OPEN ACCESS computers ISSN 2073-431X www.mdpi.com/journal/computers Article An ECMA-55 Minimal BASIC Compiler for x86-64 Linux® John Gatewood Ham Burapha University, Faculty of Informatics, 169 Bangsaen Road, Tambon Saensuk, Amphur Muang, Changwat Chonburi 20131, Thailand; E-mail: [email protected] Received: 24 July 2014; in revised form: 17 September 2014 / Accepted: 1 October 2014 / Published: 1 October 2014 Abstract: This paper describes a new non-optimizing compiler for the ECMA-55 Minimal BASIC language that generates x86-64 assembler code for use on the x86-64 Linux® [1] 3.x platform. The compiler was implemented in C99 and the generated assembly language is in the AT&T style and is for the GNU assembler. The generated code is stand-alone and does not require any shared libraries to run, since it makes system calls to the Linux® kernel directly. The floating point math uses the Single Instruction Multiple Data (SIMD) instructions and the compiler fully implements all of the floating point exception handling required by the ECMA-55 standard. This compiler is designed to be small, simple, and easy to understand for people who want to study a compiler that actually implements full error checking on floating point on x86-64 CPUs even if those people have little programming experience. The generated assembly code is also designed to be simple to read. Keywords: BASIC; compiler; AMD64; INTEL64; EM64T; x86-64; assembly 1. Introduction The Beginner’s All-purpose Symbolic Instruction Code (BASIC) language was invented by John G.
    [Show full text]
  • Preview Vbscript Tutorial (PDF Version)
    VBScript About the Tutorial Microsoft VBScript (Visual Basic Script) is a general-purpose, lightweight and active scripting language developed by Microsoft that is modelled on Visual Basic. Nowadays, VBScript is the primary scripting language for Quick Test Professional (QTP), which is a test automation tool. This tutorial will teach you how to use VBScript in your day-to-day life of any Web-based or automation project development. Audience This tutorial has been prepared for beginners to help them understand the basic-to- advanced functionality of VBScript. After completing this tutorial, you will find yourself at a moderate level of expertise in using Microsoft VBScript from where you can take yourself to the next levels. Prerequisites You need to have a good understanding of any computer programming language in order to make the most of this tutorial. If you have done programming in any client-side languages like Javascript, then it will be quite easy for you to learn the ropes of VBScript. Copyright & Disclaimer © Copyright 2015 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute, or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness, or completeness of our website or its contents including this tutorial.
    [Show full text]
  • Run BASIC – a Breakthrough Web Application Server “Web Programming for People Who Really Like to Program!” Carl Gundel, [email protected]
    Run BASIC – A Breakthrough Web Application Server “Web programming for people who really like to program!” http://www.runbasic.com Carl Gundel, [email protected] Run BASIC allows you to apply your desktop programming skills to create web applications without struggling with the overhead of typical web programming frameworks. Unlike other web programming technologies, with Run BASIC there is no state to manage, you don't need to GET or POST anything, and you never even have to think about the Common Gateway Interface. You can easily deliver interesting and rich applications that are difficult to deliver with other tools. Run BASIC hides the web technology so you can just code. Honoring a Tradition of Simplicity Run BASIC is a version of the BASIC programming language. BASIC was designed from the start to be easy for the non-computer scientist to use. A small language with simple syntax and English-like commands, BASIC is easily learned. Modern implementations of BASIC also add important features such as support for structured programming and scoped subroutines. Inspired by the approachability of BASIC we decided to create a web programming system with those important qualities. When BASIC was at the peak of its popularity in the 1980's most people who used it were users of home computers. These were usually 8-bit microcomputers that plugged into a television set. With the flick of a power switch the user would almost instantly see something like this: SuperDuper BASIC v2.3 15485 Bytes Free Ready So the user was able to immediately begin typing commands and programming the machine.
    [Show full text]