Script writing environment

Viewing 4 reply threads
  • Author
    Posts
  • September 11, 2019 at 6:19 PM #36723

    Richard Riffle
    Participant

    OK, I’m interested in writing scripts but have no Javascript experience. Further, I don’t have a Mac, only iPhones/iPods to write and debug the scripts. Is it feasible to learn to write scripts this way? Are there additional tools available for iPhone/iPod which would help? Any other options? Or should I buy a Mac?

    I have made a few brief attempts at using some of the included script fragments in Tap Forms and was able to retrieve field codes but couldn’t use those to retrieve the value of a record. The experience suggested to me that I may need a better environment to write and debug the script… among other things.

    Thanks in advance!

    September 11, 2019 at 9:12 PM #36724

    Sam Moffatt
    Participant

    I personally wouldn’t want to write a script without a physical keyboard regardless of platform and I don’t think I’d like to do too much hard core editing on the iPhone/iPod form factor. There are two reasons for wanting an actual keyboard: being able to quickly type special keys and screen real estate. There’s a detailed explanation of both at the bottom if you’re interested. Fortunately you can get a cheap Bluetooth keyboard and that will help you solve both of those problems.

    That said sooner or later I’d suggest grabbing a desktop to work on so that you can use a web browser easier and more importantly Google! You’re learning, you’re going to want to easily copy and paste stuff from the web and try things. On any iOS device, that’s going to be cumbersome. The new iPadOS stuff might make it better but at the cost of screen real estate again. On a Mac you can Command+Tab between two apps to easily copy and paste code to try. It’s a little easier to reason about importing stuff from the forums with a Mac device in a way that isn’t quite as straight for on iOS due to limitations there.

    I mentioned elsewhere (or at least thought I did) that you can go to OWC/macsales.com and pick up a cheaper, older generation, second hand Mac Mini that likely has more than enough power to run Tap Forms, hook it up to a monitor or even TV, get a keyboard and mouse (potentially Bluetooth again) and start working. There is an extra cost but if I wanted to learn, I’d prefer to do it on the desktop rather than on the phone. And if you buy the app on both platforms (you do need to buy for each of iOS and Mac), you can use the P2P sync to keep both the phone and desktops up to date (make sure both are online at the same time!).

    Detailed reason why keyboard:

    The first one is more due to how programming languages rely on keys that you don’t normally type when you’re writing text: ,, ', ", /, =, ;, |, &, !, {, }, [, ], ( and ). Writing these on a keyboard is an extra shift key for many of them however on iOS you need to go to the first layer of numbers and symbols, then sometimes the second layer and sometimes (like the quotes), need to long tap. On top of that the iOS keyboard by default will want to insert “smart” quotes and that’s going to mess things up in weird and wonderful ways if you don’t remember that long tap the quotes. I’ve been through that nightmare before with calculation fields and warn about it frequently as an iOS hazard. I also have multiple languages enabled, so every so often I tap the change language button which is right next to the symbols/numbers button and then it’s a pain to fix that. A real keyboard avoid most of these hazards and impediments.

    The second is a little less obvious early on: you want to see as much code as you can. On my iPhone 7 with the keyboard up I get:

    – landscape mode: ~9 lines of text and 64 characters per line
    – portrait mode: ~21 lines of text and 33 characters per line

    When I take the keyboard offscreen I get:

    – landscape mode: ~16 lines of text (7 more lines!)
    – portrait mode: ~32 lines of text (11 more lines!)

    If you have a dedicated keyboard, you can get these lines back that help immensely in being able to understand. I would go for landscape mode because that gives you more character width even though it’s obviously half the lines of text. What I end up seeing happening is that in portrait mode, the lines wrap more frequently and this cuts down the effective number of lines that you have visible whilst making it harder to read due to the wrapping. For perspective the old DOS terminals used to supported 80 characters per line and 25 lines.

    This ended up a little wordy, hopefully the details help.

    September 12, 2019 at 12:31 AM #36726

    Brendan
    Keymaster

    It’s always much easier to code with a desktop/laptop than it is with a mobile device. The software keyboard is not great for coding. Sam’s suggestion of a hardware keyboard can go a long way to helping with that problem, but it’s always best to have a traditional computer for coding and learning to code.

    September 14, 2019 at 5:31 AM #36749

    Richard Riffle
    Participant

    Thanks Sam and Brendan. I took your advice and got a refurbished Mac mini to run Tap Forms on and was able to write a working script within a couple hours of getting it delivered. I doubt I’d ever been able to do so just using the iPod/iPhone. I’ll probably be bothering you with scripting questions once I get further along. Thanks again.

    September 15, 2019 at 2:13 AM #36761

    Sam Moffatt
    Participant

    Thanks for letting us know! Great to hear it helped :)

Viewing 4 reply threads

You must be logged in to reply to this topic.