Home | Stories | Reviews | TreoCast | Treo Store | Accessories | Software | Discussion at PreCentral.net | Mobile | About | Search
 
treocentral.com >> Products & Reviews >> Software
NS Basic/Palm

Sun Sep 24, 2000 - 2:25 PM EDT - By Scott Hanselman

C vs. BASIC

I have been programming in Visual Basic for a number of years, so the derivative of BASIC used NS Basic was very familiar.  BASIC is well known for its gentle learning curve, and once you know one style of BASIC you can become proficient in others quickly.

NS Basic Applications don't produce a complete self contained Palm Application (PRC) when they compile.  Just like Microsoft's Visual Basic, the code produced when compiling is an intermediate form that is examined at runtime.  I like to think of it as apples turning into applesauce, on its way to being apple juice. They require an 83K runtime PRC as well.  With many Pilots having 8 MBs of RAM, this isn't the big deal it once was.  Of course, all your NS Basic Apps use the same Runtime, so it's only installed once.  Separate from the runtime, NS Basic apps tend to be very small.

 Having use Sun's KJava for Palm, I expected the NS Basic Applications to run very slowly, however I was pleasantly surprised at their responsiveness.  For most data entry and reporting applications the speed is very near the speed of the built in apps.

The hypothetical example below shows the code it would take to copy a string from a database structure into a Text Field.  As you can see, NS Basic takes care of pretty much all the memory allocation and de-allocation, as well as abstracting you from much of the Palm OS' distinctions between non-movable handles to memory, and locked pointers.
 

Metrowerks C

h = MemHandleNew (StrLen (recordP.somestring)  + 1);
p = MemHandleLock (h);
StrCopy (p, recordP.somestring);
MemPtrUnlock (p);
fld = GetObjectPtr (fldSomeField);
FldSetTextHandle (fld, h);
 

Same code using NSBasic/Palm

Result = fieldSetText("fldSomeField", recordP.somestring)

Table 1: Setting a Text field to a string from a database

User Interface – Forms and Buttons

Your form layout work will be done in NS Basic's combination code and form designer development environment. The main window shows the Pilot's screen layout on the left and the “project explorer” on the right. The editor presents a Pilot's screen and a palette of controls to choose from.  You just click and drag lists, buttons, checkboxes and more from the palette to design your forms.

My initial idea was to port (write again) my application, GlucoPilot, from C to NS Basic.  However, missing from the Palette was a Table control.  The folks as NS Basic said that Pilot Tables have a few problems with them, and that makes it “hard to make it easy.”  Their goal with NS Basic was to make the environment as powerful as possible without sacrificing ease of use, and tables did just that.  I was told they would be revisiting the issue soon, but for now I should redesign my user interface given the available controls.  GlucoPilot is a very table-centric application, so I scrapped that idea, rather than re-design it.  I could have certainly replaced my table with a “master-detail” style form, with a list at the top of the form, and controls at the bottom.  NS Basic is very well suited for these kinds of applications, and much sample code is included.

Other than the tables issue, my only real complaint with the User Interface editor was that the forms you design don't EXACTLY match the result.  They are close, but not down to the pixel.  For most apps this won't be a problem, but since the Pilot only has a 160x160 screen, sometimes every pixel counts.


Figure 1: The NS Basic/Palm Desktop and the resulting app

Next Page: Dev Environ. & Conclusion >>



Treo accessory store
 
User Opinions
Thumbs Up 57% Thumbs Down 43%

Read Opinions (7)


Would you recommend NS Basic/Palm?
Yes   No  

Product Info

References
Actions
> Print this page
> Digg!





Cases

Chargers

Bluetooth

Headsets

Keyboards

Memory
Protectors Cradles
Styli


More Treo Accessories

Spare Clip
Smartphone Experts Spare Clip
Lost or broke your belt clip?
Just $4.95 BUY

More Spare Clips
1800mAh Battery
Palm 1800mAh Battery for Treo 700p, 700w|wx, 650
Always stay powered
Just $24.95 BUY

More Batteries
 Charger Kit
Palm Charger Kit for Centro, Treo
The charger kit for the jet set crowd
Just $9.95 BUY

More Wall Chargers
 2600mAh Extended Life Battery
Seidio 2600mAh Extended Life Battery for Treo 700p, 700w|wx, 650
More power for your Treo!
Just $42.95 BUY

More Batteries
Leather Hardcase
SPE Leather Hardcase for Treo 755p, 750, 680
Sturdy and reliable
Just $12.95 BUY

More Hard Cases
kuel H10 Stylus Pen
SGP kuel H10 Stylus Pen

Just $12.99 BUY

More Styli
EHS60 3.5mm Stereo Headset
Samsung EHS60 3.5mm Stereo Headset

Just $22.95 BUY

More Stereo Headsets
Micro-USB Car Charger w/USB Port
Mobi Micro-USB Car Charger w/USB Port

Just $9.95 BUY

More Car Chargers
EHS63 3.5mm Stereo Headset
Samsung EHS63 3.5mm Stereo Headset

Just $42.95 BUY

More Stereo Headsets
ProDock Alumina
iBOLT ProDock Alumina

Just $34.95 BUY

More Car Mounts
Performance Mobile Earphones
Qmadix Performance Mobile Earphones

Just $34.95 BUY

More Stereo Headsets
Waterproof Pro-Sport Arm Pack
OverBoard Waterproof Pro-Sport Arm Pack

Just $31.95 BUY

More Weather Resistant Cases
Waterproof Smart Phone Case
OverBoard Waterproof Smart Phone Case

Just $31.95 BUY

More Weather Resistant Cases
 
 

Copyright 1999-2012 TreoCentral. All rights reserved : Terms of Use : Privacy Policy

TREO and TreoCentral are trademarks or registered trademarks of palm, Inc. in the United States and other countries;
the TreoCentral mark and domain name are used under license from palm, Inc.
The views expressed on this website are solely those of the proprietor, or
contributors to the site, and do not necessarily reflect the views of palm, Inc.
Read Merciful by Casey Adolfsson