TapBASIC new version on the way – bug fix

Edit: Update is now live!

Thanks to commenter, Guy (See Comment) for helping me find a bug in TapBASIC.    It may cause some unexpected “Missing ‘(‘” or “Name expected” errors when running a program.

It’s all fixed and I’ve submitted an update (TapBASIC version 2.5) today to Apple for review.  Hopefully, Apple will approve the update quickly.

If you’re unsure whether the error is within your code or within TapBASIC, please post here and I’ll help you sort it out.

I’m very grateful to Guy and other posters on this blog that ask for help and uncover bugs.  Thanks! If you post your issue, I may even be able to help with a bug in your code :)

TapBASIC example programs

Franklin Bretschneider, a user and beta tester of TapBASIC presents two useful TapBASIC programs.

Sine Waves

Graph some sine waves.

rem graphing waveform*
clrmem
dim x(33)
dim y(33)
for a = 1 to 33
x(a) = (a-1)/10
y(a) = 1.5+sin(2*x(a))+0.33*sin(6*x(a))
next
for a = 2 to 33
line 3+60*x(a-1),60*y(a-1),3+60*x(a),60*y(a),r
next
text "finished - open graph screen"

Click to Download

Camera exposure calculator

This program is an electronic simulation of “Focus Columbus”, the venerable old 1950′s exposure calculator, which consisted of two pivoting aluminium disks with numbers for film sensitivity, diaphragms and exposure times, how they depend on date, time of day, weather and scene type.

Although modern cameras have automatic exposure,  it still very useful, because one can, at home, and late at night, predict what one will need the next day out, for example camping in the woods.

clrmem
text "Focus Columbus"
text " compute exposure"
ask " film speed in ISO=",a
s= log(800/a)/log(2)
ask " Month (1 .. 12)",m
n=int(abs(m-6)/1.6)
ask "hour=",h
if m<3
h=h+1
endif
if m>=10
h=h+1
endif
g=int(abs(h-12)/1.1)
t=n+g
input "Weather (1 light ... 4 dark)",w
text " "
text "Subject ( 1 landscape, 2 street,"
text "3 forest, 4 room)"
input "choose 1 ... 4",x
input "property 1 light ... 4 dark",l
y=24-(s+t+w+3*(x-1)+l)
text"EV="+y
text "Aperture .... time"
for i = 0 to 5
a = 2^i
t = (2^y)/(a^2)
text"A="+a+" t=1/"+t
next

Click to Download

Feel free to submit your own programs in the comments!

Free upgrade to SophistimaCalc

Good news. TapBASIC is available on the app store and is a free upgrade for all existing SophistimaCalc users. Just update the app and you’re good to go. Enjoy.

- Major interface enhancements
- Dropbox integration
- Easy BASIC programming language: FOR/NEXT, PRINT, INPUT, WHILE/WEND, IF/ENDIF, CALL, CLS, DIM, REM and more
- Access to date and time variables
- Formatting and input options: decimal, hex and exponent
- Enhanced email functionality
- Full featured manual included in the app for easy reference

iPhone Drop Down View Custom Control

When I was coding Karats and Coins, I wanted to implement a drop down view (list) for selecting currencies, different weight measures and coin types.  I could have used UIPickerViews but I preferred the look and feel of drop down views and they also suited the space constraints of the app.  The finished product was:

Gold and Silver Calculator

The image actually shows two overlapping drop down views and therefore demonstrates the flexibility of using a drop down view instead of a UIPickerView in a constrained space.

I thought it would be helpful to share my drop down journey with other developers. You can download it here.

The Starting Point

I didn’t come up with the idea of a drop down view for iPhone programs, nor did I create the custom view.  I began with a very helpful demo program and custom class from the iPhone app Dev Help Blog.  I did, however, make some additions that I would consider improve the functionality of the custom class. I suggest you read that blog and the original code as background to the discussion here as I will assume that you are familiar with the base class and code. Continue reading