S Basic Programming for Palm OS

Total Page:16

File Type:pdf, Size:1020Kb

S Basic Programming for Palm OS S Basic Programming for Palm OS - Third Edition - The easiest way to program your Palm! Michael J. Verive 2 NS Basic Programming for Palm OS NS Basic Programming for Palm OS 3 Table of Contents Chapter I – Introduction .......................................................................... 9 Why Basic? ........................................................................................... 10 Installing NS Basic ................................................................................ 11 Chapter II - What I meant to say was... ................................................ 13 Abbreviations, terms, and mnemonics .................................................. 13 Conventions used in this book .............................................................. 16 Chapter III - Important Concepts ......................................................... 19 Palm OS and NS Basic-specific programming ..................................... 19 Object-Oriented vs. Top-Down Programming ...................................... 21 Structured Programming ....................................................................... 22 The Palm OS is "Event-driven" ............................................................ 24 Prototyping - know your audience! ....................................................... 24 Debugging/alpha/beta testing ................................................................ 25 When it’s time to scrap it and start over................................................ 25 Chapter IV - Your first project - "Hello, World!" .............................. 27 Chapter V – Constants, Literals, Variables and Arrays ..................... 31 Constants and Literals ........................................................................... 31 Variables................................................................................................ 32 Arrays .................................................................................................... 36 Chapter VI - Programming Elements ................................................... 39 Statements ............................................................................................. 39 Comments.............................................................................................. 40 Subroutines and Code Modules............................................................. 41 Functions ............................................................................................... 44 Controlling program flow...................................................................... 45 Running external applications ............................................................... 60 Ending your NS Basic application ........................................................ 63 Chapter VII - Projects and Forms ......................................................... 65 The NS Basic Project ............................................................................ 66 Forms ..................................................................................................... 67 Chapter VIII - Screen Graphics ............................................................ 75 Graphics Windows ................................................................................ 75 Drawing Graphics ................................................................................. 79 Chapter IX - S Basic Objects .............................................................. 93 Bitmap ................................................................................................... 93 Button .................................................................................................... 95 CheckBox .............................................................................................. 97 Field ..................................................................................................... 101 Gadget ................................................................................................. 105 4 NS Basic Programming for Palm OS Grid...................................................................................................... 110 Label .................................................................................................... 116 List ....................................................................................................... 118 PopUp .................................................................................................. 126 PushButton .......................................................................................... 133 Repeater ............................................................................................... 136 ScrollBar.............................................................................................. 138 Selector ................................................................................................ 140 Slider ................................................................................................... 143 Shift Indicator ...................................................................................... 145 Chapter X - umeric functions ............................................................ 147 Standard Mathematical Functions ....................................................... 147 Exponents, Powers and Logs .............................................................. 158 Chapter XI - String Handling .............................................................. 163 Conversions ......................................................................................... 163 Concatenation, Extraction and Truncation .......................................... 168 Searching Strings – using InStr ........................................................... 176 Chapter XII – Date and Time functions ............................................. 179 Date Functions..................................................................................... 180 Time Functions .................................................................................... 187 Chapter XIII - Database Management ................................................ 195 Creating Databases .............................................................................. 197 Opening Databases .............................................................................. 200 Closing and Erasing Databases ........................................................... 201 Data Access – a Parting of the Ways .................................................. 203 Safely mixing keyed and non-keyed methods..................................... 222 Writing to MemoPad ........................................................................... 226 Chapter XIV – Menus ........................................................................... 231 Creating Menus ................................................................................... 232 Chapter XV - Interacting with your user ............................................ 237 Interacting Visually - Message and Alert Boxes ................................. 237 Interacting Audibly - Beep, Sound and PlaySound............................. 241 Trapping user actions .......................................................................... 244 Chapter XVI - Serial Input/Output (I/O) ........................................... 249 Chapter XVII - Extending S Basic .................................................... 261 Accessing the Palm OS API ................................................................ 261 Shared Libraries .................................................................................. 265 Chapter XVIII - Special Topics ........................................................... 271 Control Arrays ..................................................................................... 271 Printing in NS Basic ............................................................................ 272 String parsing ...................................................................................... 277 NS Basic Programming for Palm OS 5 Data Encryption................................................................................... 279 Sorting Data......................................................................................... 281 Running HotSync from NS Basic ....................................................... 283 Soundex ............................................................................................... 284 Staying Alive ....................................................................................... 284 Saving State ......................................................................................... 285 System Info ......................................................................................... 285 SysInfoSet ........................................................................................... 286 Real Estate - location, location, location! ........................................... 287 Optimizing applications for speed....................................................... 287 Appendix A. Palm OS sort (string comparison) order. ...................... 293 Appendix B. Palm OS Fonts .............................................................. 295 Appendix C. Accessory Programs ...................................................... 301 Appendix D. Running POSE ............................................................... 309 Index .......................................................................................................
Recommended publications
  • Note to Students
    COURSE NOTES: H=Humanities, H/SP=Humanities/Skills Performance NS=Natural Science, SS=Social Science Course Descriptions Adult Education – ADABE 062–Math 4 NOTE TO STUDENTS: Cr: 1-6 Wkly hrs: 6 hours Lecture Adult Basic Education Students who take this course will be able to Common Course Numbers/Titles problem solve using whole numbers, fractions, ADABE 008–Spelling decimals, percents, ratios, and proportions, To make it easier for students to transfer Cr: 1-6 Wkly hrs: 6 hours Lecture perimeter, area, volume, simple interest, and credits among the State’s 34 community Students will learn how to spell by making charts, graphs, and tables. (Pass/No Credit) and technical colleges, some courses are sense of the English spelling system and Prerequisite: Orientation/placement or numbered and titled in a similar way at every understanding spelling rules. (Pass/No Credit) permission of instructor. community college in the state. Prerequisite: Orientation/qualifying score on state standardized assessment. ADABE 071–Communication Skills 5 Courses that have been identified as Common Cr: 1-6 Wkly hrs: 6 hours Lecture Course Numbers have an “&” sign in the ADABE 009–Orientation to Adult Ed Students who complete this course will be course number, for example: ENGL& 101. Cr: 1 Wkly hrs: 1 hours Lecture able write clearly using standard grammar, An introduction to Olympic College and its usage, and punctuation; collect, interpret, Adult Education Program. Students learn and integrate information using multiple to set goals, make an educational plan, and resources, and use a computer to complete Independent Study assess their own progress. May be taken routine tasks.
    [Show full text]
  • Astromist 2.2 User Guide
    Astromist 2.2 User Guide Astromist 2.2 User Guide 1. Introduction.........................................................................................6 1.1. Objectives.................................................................................................................................. 6 1.2. Main features............................................................................................................................. 7 1.3. Limitations ................................................................................................................................. 9 1.3.1. Scope drives ................................................................................................................... 9 1.3.2. Photos............................................................................................................................. 9 2. Installation ........................................................................................10 2.1. Prerequisites ........................................................................................................................... 10 2.1.1. Operating system.......................................................................................................... 10 2.1.2. Hardware ...................................................................................................................... 10 2.1.3. Required “Plug-Ins”....................................................................................................... 10 2.2. Free and Registered
    [Show full text]
  • Free Downloadable Android Studio Sample Projects How to Use Downloaded Samples in Android Studio? I Have Downloaded Samples from SDK Manager
    free downloadable android studio sample projects How to use downloaded samples in android studio? I have downloaded samples from SDK Manager . Can any one tell me how to use those samples to create a project in android Studio. Import a android code sample. in the main menu but its asking for download again. Where will these samples be placed when i downloaded from SDK manager? How can i use it to create a project? 1 Answer 1. If you can't import the android code sample from android studio, make sure that the path below is not empty : For example you should have android-16, android-19, android-21 folders which contains samples project. EDIT 1 : To find your android sdk path from Android studio : Free downloadable android studio sample projects. Completing the CAPTCHA proves you are a human and gives you temporary access to the web property. What can I do to prevent this in the future? If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware. If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices. Another way to prevent getting this page in the future is to use Privacy Pass. You may need to download version 2.0 now from the Chrome Web Store. Cloudflare Ray ID: 67d9819b78111600 • Your IP : 188.246.226.140 • Performance & security by Cloudflare. Android Example Projects.
    [Show full text]
  • 1 Star Trac Pro Partner – Training Partner Operations Manual Table of Contents I. Introduction II. Selecting Workout Partner
    Star Trac Pro Partner – Training Partner Operations Manual Table of Contents I. Introduction II. Selecting Workout Partner a. Creating a Custom Workout III. Creating a Pro or Elite Treadmill Custom Workout a. Naming Your Workout b. Entering Weight/Time c. Designing Your Incline Profile d. Designing Your Speed Profile IV. Creating a Pro Bike Custom Workout a. Naming Your Workout b. Entering Weight/Time c. Designing Your Resistance Profile V. Accessing a Custom Workout VI. Beaming a Custom Workout a. Beaming to a Pro or Elite Treadmill b. Beaming to a Pro Bike c. Beaming to a PDA Device VII. Editing a Custom Workout VIII. Deleting a Custom Workout IX. Reviewing a Completed Workout X. Collecting an Existing Workout from a Pro or Elite Treadmill or Pro Bike XI. Appendix A: List of PDAs Compatible with Pro Partner 1 I. Introduction Thank you for choosing Star Trac for your fitness needs. Are you ready to take your clients’ workout to a new level? The Star Trac Pro Partner software program will make your Palm-powered PDA (Personal Digital Assistant) an integral part of your personal training experience when using a Star Trac Pro or Elite Treadmill or Pro Bike. Personalized workouts and tracking client workout data are now all in the palm of your hand! In this manual you will learn how to use the Training Partner application to design custom workouts and track workout information for your clients for a more personal approach. It’s simple! Just follow the steps in this user manual and you’re one step closer to making your personal training more efficient.
    [Show full text]
  • List of Palm OS Versions Included on Palm Handhelds, and Possible Upgrades
    List of Palm OS versions included on Palm handhelds, and possible upgrades www.palm.com < Home < Support < Knowledge Library Article ID: 10714 List of Palm OS versions included on Palm handhelds, and possible upgrades Palm OS® is the operating system that drives Palm devices. In some cases, it may be possible to update your device with ROM upgrades or patches. Find your device below to see what's available for you: Centro Treo LifeDrive Tungsten, T|X Zire, Z22 Palm (older) Handspring Visor Questions & Answers about Palm OS upgrades Palm Centro™ smartphone Device Palm OS Handheld Palm OS version Palm Desktop & version (out- Upgrade/Update after HotSync Manager of-box) available? upgrade/update update Centro (AT&T) 5.4.9 No N/A No Centro (Sprint) 5.4.9 No N/A No Treo™ 755p smartphone Device Palm OS Handheld Palm OS version Palm Desktop & version (out- Upgrade/Update after HotSync Manager of-box) available? upgrade/update update Treo 755p (Sprint) 5.4.9 No N/A No Treo™ 700p smartphones Device Palm OS Handheld Palm OS version Palm Desktop & version (out- Upgrade/Update after HotSync Manager of-box) available? upgrade/update update Treo 700p (Sprint) Garnet Yes N/A No 5.4.9 Treo 700p (Verizon) Garnet No N/A No 5.4.9 Treo™ 680 smartphones Device Palm OS Handheld Palm OS version Palm Desktop & version (out- Upgrade/Update after HotSync Manager of-box) available? upgrade/update update Treo 680 (AT&T) Garnet Yes 5.4.9 No 5.4.9 Treo 680 (Rogers) Garnet No N/A No 5.4.9 Treo 680 (Unlocked) Garnet No N/A No 5.4.9 Treo™ 650 smartphones Device Palm OS
    [Show full text]
  • Hart Pocket Configurator for Palm Organizer Features
    HART POCKET CONFIGURATOR FOR PALM ORGANIZER The HPC301 Hart Pocket Configurator is a new HPC301- HART® Configurator Screen Configurator Software from Smar for HART® protocol Instruments and systems. This has been developed to work with a Palm Organizer. The configurator consists of HPC301 (the software), HPI311 (the interface) and acessories to configure and calibrate HART® equipment. This packageconfigures Series 301 products from Smar and many others wich have the HART® protocol and where a portable configurator is needed. It therefore can be used to configure field devices. Interface HPI311 V-HART® PalmVx Handheld FEATURES üThis configuration tool supports various commercial üIt can support various devices from different types of handheld based on Palm O.S. vendors. (The generic configuration tool üMuch faster than other handheld solutions. version is always available) üProduct User's Guide and Device Information üOnly one software application can configure could be provided online. (Online Help) various field devices. (No need datapacks or memory modules for every device type). üRechargeable battery. (The interface power üSynchronize data with the PC. Configuration supply can recharge both handheld and interface). files can be exchanged with PC applications. üEasy to upgrade on site. üOther useful programs could be installed in the handheld. (For example Unit Converter, History üEasy Interface Connection Reports, E-mail, etc.). üBattery Status Indicator üLight and slim. It really fits in a pocket. üStandard modem D11 smar ORDERING CODE DESCRIPTION CODE Description Palm-VX Palm Vx handheld Palm-IIIC Palm IIIc handheld HPI311-V HART Pocket Interface for Palm V handhelds (includes HPC301 software) HPI311-III HART Pocket Interface for Palm III handhelds (includes HPC301 software) D12 smar.
    [Show full text]
  • Palm OS Cobalt 6.1 in February 2004 6.1 in February Cobalt Palm OS Release: Last 11.2 Ios Release: Latest
    …… Lecture 11 Market Overview of Mobile Operating Systems and Security Aspects Mobile Business I (WS 2017/18) Prof. Dr. Kai Rannenberg . Deutsche Telekom Chair of Mobile Business & Multilateral Security . Johann Wolfgang Goethe University Frankfurt a. M. Overview …… . The market for mobile devices and mobile OS . Mobile OS unavailable to other device manufacturers . Overview . Palm OS . Apple iOS (Unix-based) . Manufacturer-independent mobile OS . Overview . Symbian platform (by Symbian Foundation) . Embedded Linux . Android (by Open Handset Alliance) . Microsoft Windows CE, Pocket PC, Pocket PC Phone Edition, Mobile . Microsoft Windows Phone 10 . Firefox OS . Attacks and Attacks and security features of selected . mobile OS 2 100% 20% 40% 60% 80% 0% Q1 '09 Q2 '09 Q3 '09 Q1 '10 Android Q2 '10 Q3 '10 Q4 '10 u Q1 '11 sers by operating sers by operating iOS Q2 '11 Worldwide smartphone Worldwide smartphone Q3 '11 Q4 '11 Microsoft Q1 '12 Q2 '12 Q3 '12 OS Q4 '12 RIM Q1 '13 Q2 '13 Q3 '13 Bada Q4' 13** Q1 '14 Q2 '14 s ystem ystem (2009 Q3 '14 Symbian Q4 '14 Q1 '15 [ Q2 '15 Statista2017a] Q3 '15 s ales ales to end Others Q4 '15 Q1 '16 Q2 '16 Q3 '16 - 2017) Q4 '16 Q1 '17 Q2 '17 3 . …… Worldwide smartphone sales to end …… users by operating system (Q2 2013) Android 79,0% Others 0,2% Symbian 0,3% Bada 0,4% BlackBerry OS 2,7% Windows 3,3% iOS 14,2% [Gartner2013] . Android iOS Windows BlackBerry OS Bada Symbian Others 4 Worldwide smartphone sales to end …… users by operating system (Q2 2014) Android 84,7% Others 0,6% BlackBerry OS 0,5% Windows 2,5% iOS 11,7% .
    [Show full text]
  • Visualització 4D a Través De Mòbils Android
    UNIVERSITAT OBERTA DE CATALUNYA Enginyeria Informàtica Visualització 4D a través de mòbils Android Alumne/a: Òscar Estévez Soler Dirigit per: Laia Descamps Vila Co-dirigit per: CURS 2011-2012 (Febrer/Setembre) Aula 1: Sistemes d’informació geogràfica 2on semestre curs 2011-2012. Alumne: Òscar Estévez Soler Visualització 4D a través de mòbils Android 05.032-TFC-SIG Curs 2011-12. 2on Semestre Òscar Estévez Soler Aula 1: Sistemes d’informació geogràfica 2on semestre curs 2011-2012. Alumne: Òscar Estévez Soler Dedicatòria A la petita Ia, el seu somriure m’encoratja a continuar esforçant-me cada dia. A la Nuri, amb tu tinc encetat el millor projecte de la meva vida. Aula 1: Sistemes d’informació geogràfica 2on semestre curs 2011-2012. Alumne: Òscar Estévez Soler ÍNDEX 1. Agraïments _______________________________________________________ 1 2. Introducció _______________________________________________________ 2 2.1. Introducció als SIG aplicats a la telefonia mòbil __________________________ 2 2.2. Introducció al PFC __________________________________________________ 5 3. Eines de desenvolupament __________________________________________ 7 3.1. Eclipse ____________________________________________________________ 8 3.2. Android SDK ______________________________________________________ 10 3.3. Framework de realitat augmentada ___________________________________ 11 3.4. Base de dades ______________________________________________________ 14 4. Zona d’interès a treballar __________________________________________ 17 4.1. Selecció ___________________________________________________________
    [Show full text]
  • Quartus Handheld Software: Discussion Forum: General
    This document holds all the Quartus Handheld Software discussion forum messages from March 17, 2000 to 6:31pm, December 17, 2000. The links in the document all work -- but please don't try and post new messages to the Forum via the buttons in this document, as the subject threads may eventually be archived from the web site. Enjoy! Neal Bridges Quartus Handheld Software http://www.quartus.net Discussion Forum General December 17 - 06:31 pm [236] Quartus Forth (PalmOS version) December 17 - 04:20 pm [2833] Questions and discussion about the Quartus Forth on-board compiler for Palm/Visor/WorkPad handhelds. Quartus Forth (Royal daVinci version) April 11 - 09:15 pm [19] Questions and discussion about the Royal daVinci version of the Quartus Forth on-board compiler. Other Quartus Products December 17 - 02:12 pm [25] All other (non-Forth) Quartus products. Everything else! December 5 - 02:37 pm [105] Anything you'd like to talk about! Back to the Quartus Home Page NOTE: When posting Forth source code, to preserve indentation, format it using the "\pre{}" tag like this: \pre{ : hello \ A simple message: ." Hello World!" 10 0 do i . loop cr ; } If you wish to include a } character, enter it as: \} General Quartus Handheld Software: Discussion Forum: General ● Archive of the forum 12/17 06:31pm [2] ● Manual in Doc or TealDoc format 12/14 04:23pm [3] ● Starting New Project 12/10 06:59am [2] ● PalmSource 2000 12/14 12:38am [8] ● Easy Data Input From Paper 12/12 03:56pm [11] ● IBM Palm Devices 12/7 03:44am [3] ● Message Archives temporarily unavailable
    [Show full text]
  • Razvoj Mobilnih Aplikacija Priručnik Za 4
    RAZVOJ MOBILNIH APLIKACIJA PRIRUČNIK ZA 4. RAZRED GIMNAZIJE AUTORI: ZLATKO STAPID, IVAN ŠVOGOR i DAVOR FODREK VARAŽDIN, 2016. Priručnik je izrađen u sklopu projekta „HEUREKA – spoznajom do uspjeha“ kojeg je financirala Europska unija. EUROPSKA UNIJA Ulaganje u bududnost Projekt je financirala Europska unija u 100%-om iznosu iz Europskog socijalnog fonda kroz Operativni program „Razvoj ljudskih potencija 2007.-2013., poziv na dostavu projektnih prijedloga HR.3.1.20 Promocija kvalitete i unaprjeđenje sustava odgoja i obrazovanja na srednjoškolskoj razini. Sadržaj ove publikacije / emitiranog materijala isključiva je odgovornost Srednje škole Ivanec SREDNJA ŠKOLA IVANEC – nositelj projekta Ravnateljica: mr.sc. Lidija Kozina dipl.oec Eugena Kumičida 7, 42 240 Ivanec Telefon: 042 782 344; Faks: 042 781 512 E-mail: [email protected] Web: http://www.ss-ivanec.hr/ SREDNJA ŠKOLA MATE BLAŽINE LABIN – partner na projektu Ravnatelj: Čedomir Ružid, prof. Rudarska 4, 52 220 Labin Telefon: 052 856 277; Faks: O52 855 329 E-mail: [email protected] Web: http://www.ssmb.hr Posredničko tijelo razine 1 Ministarstvo znanosti, obrazovanja i sporta Ulica Donje Svetice 38, 10000 Zagreb E-mail: [email protected] Web: http://public.mzos.hr Posredničko tijelo razine 2 Agencija za odgoj i strukovno obrazovanje i obrazovanje odraslih, Organizacijska jedinica za upravljanje strukturnim instrumentima Radnička cesta 37b, 10000 Zagreb E-mail: [email protected] Web: http://www.asoo.hr/defco Za više informacija o EU fondovima u RH: www.mrrfeu.hr, www.strukturnifondovi.hr Autori: Zlatko Stapid, Ivan Švogor i Davor Fodrek Nakladnik: Sveučilište u Zagrebu, Fakultet organizacije i informatike Pavlinska 2, 42000 Varaždin Za nakladnika: Prof.dr.sc.
    [Show full text]
  • Mobile OS and Security Aspects
    …… Lecture 11 Market Overview of Mobile Operating Systems and Security Aspects Mobile Business I (WS 2015/16) Prof. Dr. Kai Rannenberg . Deutsche Telekom Chair of Mobile Business & Multilateral Security . Johann Wolfgang Goethe University Frankfurt a. M. Overview - Market Overview of Mobile Operating …… Systems and Security Aspects § The Market for mobile devices and mobile OS § Mobile OS unavailable to other device manufacturers § Overview § Palm OS § Apple iOS (Unix-based) § Manufacturer-independent mobile OS § Overview § Symbian platform (by Symbian Foundation) § Embedded Linux § Android (by Open Handset Alliance) § Microsoft Windows CE, Pocket PC, Pocket PC Phone Edition, Mobile § Microsoft Windows Phone 10 . § Firefox OS . § Security features of selected mobile OS . 2 Worldwide Smartphone Sales to End …… Users by Operating System (2009-2015) Market share Market . OS [Statista 2015a] 3 Worldwide Smartphone Sales to End …… Users by Operating System (Q2 2012) Android 64,2% Others 0,6% Symbian 5,9% Bada 2,7% BlackBerry OS 5,2% [Gartner2013] Windows 2,6% . iOS 18,8% . Android iOS Windows BlackBerry OS Bada Symbian Others 4 Worldwide Smartphone Sales to End …… Users by Operating System (Q2 2013) Android 79,0% Others 0,2% Symbian 0,3% Bada 0,4% BlackBerry OS 2,7% Windows 3,3% iOS 14,2% [Gartner2013] . Android iOS Windows BlackBerry OS Bada Symbian Others 5 Worldwide Smartphone Sales to End …… Users by Operating System (Q2 2014) Android 84,7% Others 0,6% BlackBerry OS 0,5% Windows 2,5% iOS 11,7% . Android iOS Windows BlackBerryBlackBerry OS Symbian Bada Others [Statista 2014a] 6 Worldwide Smartphone Sales to End …… Users by Operating System (Q2 2015) Android 82,8% Others 0,4% BlackBerry OS 0,3% Windows 2,6% iOS 13,9% .
    [Show full text]
  • Fastcpu V.3.0
    FastCPU v.3.0 Megasoft2000 Ltd 1999 - 2002 Palm Software Division (PSD) Platform: Palm OS 3.5, 4.0, 4.1 FastCPU program is designed to control your device speed parameters. Using this program you are enable not only to multiply the speed of your applications performance by nearly 2 but also to save the system energy understating data bus and central processing unit (CPU) clock rate. Subconsciously comprehensive and simple control will allow you to run your system comfortably. Note! 1. Before installation make sure the date on your Palm device is valid (use the Preferences application). 2. Some frequency values may lead to unstable beam receiving (depending on hardware). 3. On some Palm m505 devices problems with digitizer sensitivity may occur at very high frequencies. 4. On some Palm IIIc devices incorrect graphics display may happen at increased frequencies. Should this happen, you must select the optimal frequency for your device (by trial and error) which allows it to display the information on the screen without image distortion. 5. This program is free to use for a 14 - day trial period. Please purchase this program only after ensuring that it works properly on your device. Installation. To install this game you should synchronize the "FastCPU_xxx.prc" application to your device. Files can be installed by using the Desktop S/W or just any other application. • FastCPU_ Color_HR_SZ.prc For color device (320x320, 16 Bits): Sony Clie` PEG-T650/665/675, NR-70/70V, ... • FastCPU_ Color_HR.prc For color device (320x320, 8 Bits): Sony Clie` PEG-N760, N610, T615, T625, ..
    [Show full text]