Newbie needs a push!

Discuss PocketC for Palm OS (including Desktop Edition)

Postby Chimera on Sat Mar 17, 2001 3:46 pm

Hi Everyone,
I'm new to PalmOS and would like to do some programming. I have only a little experence with C so I will be learning as I go. Can some of you seasoned PocketC user tell me anything that will convince me to go with PocketC as opposed to OnboardC which seems to have no support or Quartus Forth which I have already been evaluating and seems way too far over my head. I understand that PocketC requires a runtime for distributed applets and at this time don't see that as a limitation. I like the compactness of Pocketc programs as compared to OnboardC. I guess my problem is the idea that PocketC is considered by some to be a toy language. Can really useful things be done with it. Is anyone writing programs as shareware and actually making some pocket change with it? I also like the idea of being able to run the same applet on WinCE as I have some friends you use those platforms also.

I have some questions also.
1. PocketC doesn't support Doc format files at all correct?
2. How do you include a memo for multi-memo projects. I haven't been able to find that in the documentation yet.
3. Would I be able to fill in the gaps in my C knowledge by reading a generic C book and still be able to apply that to PocketC?
4. I have not yet spent much time looking, but can someone point me to a really good tutorial for PocketC.
5. Can RsrcEdit be used to create resources for PocketC programs?

I appreciate any help anyone can provide.
Thanks to all,
Posts: 2
Joined: Sat Mar 17, 2001 3:22 pm

Postby wossname on Sat Mar 17, 2001 5:39 pm

Hi Tim.

I suggest you print out the longer version of the instructions as well as the file about built in functions. Everything you need to know is in those.

PocketC is quite a good product, but it is incredibly slow and has many key elements missing (the equivalent of Basic's ASC() function is not a standard function for PocketC and there seems to be no way to determine the colour of a pixel on the screen.

But overall, it is my favorite program for the Palm series of computers. Although i'm looking into ASM as a way of expanding PocketC's library of procedures.

Wossname :)
Wossname :)
Are you <i>local</i>?
Posts: 275
Joined: Sat Feb 24, 2001 7:18 am

Postby Velvis on Sat Mar 17, 2001 8:24 pm

Pocket C is a good starter program for learning C. It is not a "ANSI" standard C, so its not "official" C.

Pocket C is also not "real" PalmOS programming. That is, much of what you will learn will not be really applicable if you want to start using Codewarrior or GCC (free) to develop Palm programs.

Pocket C is an easy way to get your feet wet and at the same time develop real programs.

Pros: Cheap, easier than other development systems, great help on the forum (here), can write apps anywhere.

Cons: Slow, requires a runtime, most skills wont transfer to other environments.

As far as making money with it, I find the resulting apps are to slow and the runtime (IMO) is a drawback to many end-users.

RsrcEdit will not work with PocketC.
Palm PocketC and WinCE PocketC are not compatable.

I would look into CASL, which for ($60) can create PalmOS/and WinCE (beta version) programs. For an additional $40 (CASLpro)you can generate true C native PalmOS apps which do not require a runtime on the Palm.

PocketC is fun and some nice stuff has been done with it, but if you intentions are to make money and develop real PalmOS programing skills I'd look to Codewarrior or GCC.
Posts: 226
Joined: Mon Dec 11, 2000 2:32 am

Postby Vilmos on Sat Mar 17, 2001 8:25 pm

I have registered both PocketC and Quartus Forth. I have also looked into OnboardC. As far as OnboardC goes you would be better off buying CodeWarrior as you would need to know it intimately to get anything done with OnboardC.

PocketC is an excellent beginning point and many quality applications can be written with it, but it fails at giving access to the actual PalmOs API. Quartus Forth on the other hand gives full access to the Palm API but requires you to learn Forth.

If you are just starting to learn a language, PocketC will probably be easier to pick up. Quartus Forth is a much more robust system, you can code just about anything that could be done in CodeWarrior.

For my purposes I discovered that the speed of PocketC was just not fast enough, and I am interested in using more of the PalmOS than is available with PocketC. Sure I can write native libraries, and I have in the past, but if I have to keep doing that I might as well do the coding in another language and save the step. This is why I've moved over to Quartus Forth for my next big project. I'm also mainly interested in doing the development on the Palm itself. My program quickly got too large for PocketC to compile on the device, which led to desktop development. This aspect of PocketC has gotten some attention lately and I would be curious to see how large an app people can successfully compile on the Palm itself.

So in the end: I'm quite used to C and PocketC so it is still valuable for quick and dirty applications. For serious work I'm using Quartus Forth and teaching myself a new language (plus the Palm API).

Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada

Postby iebnn on Sat Mar 17, 2001 9:06 pm

wait, if quartus forth is on the palm, why can't someone add the feature to PocketC to make PalmOS API calls? The most frusterating thing about PocketC is that there is no text editing support... grr.. and the speed
I'm moving to AppForge ( for my next large project :)
what is forth programming like?
appforge uses Visual Basic (the real product, it's an addon to it)
Posts: 42
Joined: Fri Feb 09, 2001 8:40 pm

Postby Vilmos on Sun Mar 18, 2001 12:30 am

Have you looked into AppForge? It is also a virtual machine and does not support all the features of the PalmOS. Last I heard they didn't even have menu support. For $600 you can do a lot better.

As for adding the Palm API to PocketC, it could definately be done, but there is no point really. You use the native libraries to plug the biggest holes in PocketC, but if you want all of the system calls you should be moving to another development platform.

Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada

Postby Vilmos on Sun Mar 18, 2001 1:08 pm

Just an update for iebnn: I was just looking at AppForge again out of curiosity and it also doesn't support TCP/IP libraries. I just thought you might want to know.

Posts: 174
Joined: Tue Dec 05, 2000 6:13 pm
Location: Canada

Postby Chimera on Sun Mar 18, 2001 2:38 pm

Hi again,
I guess I should have pointed out that I work mainly with a Mac for my Desktop, so Appforge and others are not an option. My wish is to program on the palm not the desktop. That means learn Forth (not easy), use OnboardC or PocketC. PocketC seems like the best of the two in that it has larger following and its possible to extend it with libraries etc. This lack of fulltime palm api doesn't seem like a big deal to me since you don't need all the api all the time. More libraries are bound to come along to plug the holes.
Thanks for the input!
Posts: 2
Joined: Sat Mar 17, 2001 3:22 pm

Postby Velvis on Sun Mar 18, 2001 3:35 pm

I dont know if GCC is available for the Mac, but if you buy any of the Palm programming books they come with Codewarrior Lite which will get you started. (I am assuming CW light is available for the Mac)
I'l tell you one thing, I dont miss the days of having an Amiga and hearing "Nope its only available for the PC".
The PC isnt perfect by any means (there are still some things I miss from my Amiga from 5-6 years ago that Windows doesnt do), but there are no compatibility issues.
Good luck with whatever you choose.
Posts: 226
Joined: Mon Dec 11, 2000 2:32 am

Postby wolfgang on Sun Mar 18, 2001 7:24 pm


I think I drop some of my opinion in as well.

That's what I think of PocketC:


- VERY easy to learn, and (I know I'm contradicting some of the fellows here) most skills CAN be transferred to regular C. If I am correct, you are new to programming anyway, and the basic methods, syntax and strategies are the same in C and PocketC. What is different is mainly the set uf library functions available.

- You get going much faster with PocketC (minutes) than with Codwarrior or the like (at least weeks). These are more professional development environments, but require a steep and long learning curve to get to your first program, which can be very frustrating. I'd say they are the right choice if you are a professional programmer. For a weekend coder they are too much headache (even for me, an I AM a professional programmer in my day time job).

- You can program directly on your handheld. I like this feature since most of my projects were written "on the road", to pass some time at the airport etc.

- The PocketC community is very active and helpful.

- For an introduction to PocketC programming, look at my website in the ABC section:

This is a tutorial for absolute beginners.

- Yes, it is possible ot do professional programs in PocketC and sell them for hard money. You find a couple examples on my homepage. Within a few months their sale covered all my costs (handheld, flash storage card, PocketC registration) and now I am making some money on it. I won't get rich that way, but it's not bad for a weekend's pastime. (Note, however, that I wrote these programs for the WindowsCE version of PocketC. But I plan to port some of this stuff over to the palm as my next large project).


- It's not standard C, true. But on the other hand, its much easier and friendlier than standard C (automatic type conversion, string datatype, etc.).

- It's definitely much slower that Codewarrior programs. This IS an issue with action games. But many applications don't need the speed anyway (many database apps for example). It really depends on what you want to do with it. And there is a very good and fast library out and available for free that provides many features you need for game programming (fast graphics etc.).

You see, I'm hooked.

As for the multi-memo question: Use the #include pragma:

Memo you want to include:

// memo1
some code

Main memo:

// memo_main
#include "memo1"

some other code

This will include the code of memo1 into memo_main.

Composing music on the PocketPC! -
Posts: 281
Joined: Tue Dec 12, 2000 4:22 am
Location: USA

Postby slmiller on Mon Mar 19, 2001 10:47 pm

I would just like to add one bit that I didn't see mentioned before. OnboardC, while compiling a totally self-contained program that is fast, uses exactly the same programming syntax and methods as does CodeWarrior. If you want to do OnboardC, do CodeWarroir first. It'll be easier.

The other thing is that PocketC does not have native support for RsrcEdit databases, but they can be used (and quite quickly) with the excellent PToolBox made by J. Stadolnik. It allows complete interaction with Palm native databases.

Duct tape is The Force. It has a light side, a dark side, and it holds the world together.

Edited by - slmiller on 03/19/2001 16:52:14

Edited by - slmiller on 03/19/2001 16:53:19
"To beer. The cause of, and solution to, all of life's problems" - Homer Simpson
Posts: 63
Joined: Mon Jan 08, 2001 6:09 pm
Location: USA

Postby jstadolnik on Tue Mar 20, 2001 1:55 am

With regards to non-pocketC development, I'm partial to OnboardC. Any code written with it will compile under the gcc/PRC-tool/PilRC chain. (I prefer gcc over codewarrior, because 1) it's free, and 2) it generates smaller .prc files.)

However, I find roadcoding with palm API on a PDA to be most unbearable for three reasons, 1) API work can be nasty, especially the form user interface parts (text fields, tables, menus, scrollbars, etc), 2) you need to have compressed/searchable versions of the palm SDK installed on your PDA to get anything done, and 3) API generally requires a lot of support code (such as managing handles, record locks, etc). In short, doing a lot API work on tiny screen without a keyboard and searchable palm SDK reference is much like a bad dentist visit.

PocketC is nice in that is provides a high level access to many API capabilities (database, graphics, math functions, serial I/O). In doing so, it handles much of the dirty work support logic for you. If you coded the built-in pocketC function equivalents for gcc/codewarrior, you would have a lot of fairly complex source code on your hands.

Having a good set of higher level functions makes PocketC a really easy language to pick-up and use.

I particulary like it that PocketC supports pointers, this allows you to do implement all kinds of data structures and algorthms.

Due to it's speed, pocketC is not suitable for apps which require a lot of horsepower (but most app don't). Dispite this, you still can do an amazing amount with it. Take a peek at the "PocketC Applet" category at palmgear.

To be fair, other decent development apps not yet mentioned are SuperWaba (java) and HotpawBasic (basic). SmallBasic may also be decent someday, but it's quite young at the moment.


slmiller: The toolbox only handles bitmap resources... with the palm API there are many other types (forms, text fields, menus, etc.)

wossname: You can get pixel values with the GetPixel function in the PToolbox lib, and you get the ascii value of a char by casting it as an int (e.g. char x; x='A'; puts((int)x);"
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 3 guests