NS Basic/App Studio 1.4.2 released!

We happy to announce that Version 1.4.2 is ready!

It features a new Ajax() function, a new collections datatype and a bunch of fixes and minor enhancements.

The URL is the same as before.

1.4.2

  1. Language: Added new Ajax() function.
  2. Language: Support added for Collections.
  3. Samples: Added AjaxPost sample: reverse a string and save as file on server.
  4. Samples: Add Collections sample.
  5. Samples: New C# WebSockets sample. (Thanks to Christian Probst!)
  6. Controls: Added false to Hidden property.
  7. Controls: Font styling added to DateTime controls.
  8. Controls: Allow width to be changed on Checkbox, RadioButton.
  9. Docs: Handbook and Language Reference updated.
  10. Translator: BTNew changing to BTnew fixed.
  11. Translator: If a then MsgBox 0 fixed.
  12. Translator: MsgBox 0 no longer shows blank.
  13. Translator: Case of ‘Case’ no longer changed to ‘case’
  14. Translator: MsgBox false no longer shows blank.
  15. Translator: Object.Add and Object Delete added: collections!
  16. Translator: UBound(object) returns items in object.
  17. Translator: Comments with embedded colons fixed.

Documentation Changes for Version 1.4.2

  1. The new Ajax function is a more powerful version of ReadFile(). It can directly replace ReadFile, plus do POST. POST lets you send larger files to the server – the usual limit is 8 megs, but this can be increased. Calling arguments are Ajax(URL, method, data), which URL is the name of the file or server side script, method is GET or POST, and data is a string containing the data you wish to transfer. Only the URL argument is required: if method is not supplied, it defaults to GET.

  2. Collections: A collection is like an array, except the members are accessed by name instead of number.

NS Basic/App Studio 1.4.1 Released!

We happy to announce that Version 1.4.1 is ready!

It features a much easier to use and more powerful RadioButton, ToolBox search, multiple forms at one time and better AJAX capabilities. There is also a long list of smaller enhancements and fixes.

The URL is the same as before.

Here’s the complete list of what has been changed:

1.4.1

  1. Controls: Add new RadioButton control. Replaces OptionButton.
  2. Language: ReadFile() can now specify method. See Language Reference.
  3. Code Window: Auto Indent/Outdent improved for Select and Do Loop.
  4. Controls: Form has new properties: left, top and openMode.
  5. Controls: Button: fix iOS padding problem. Now matches Design Screen.
  6. Controls: Button: Orange flash on Android should finally be gone.
  7. Controls: Grid – cellstyle now applies to all cells.
  8. Controls: TextBox: fix iOS padding problem. Now matches Design Screen.
  9. Docs: Handbook and Language Reference updated.
  10. IDE: Typo fixed in save message.
  11. Language: NSBVersion fixed.
  12. Runtime: Improve logic to hide URL bar on iOS.
  13. Runtime: NSB.InputBox bombed when used with Sencha Touch.
  14. Runtime: NSB.InputBox no longer bounces in Android.
  15. Runtime: Multiple forms can be opened side by side.
  16. Samples: Added new Ajax sample.
  17. Samples: Added new RadioButton sample.
  18. Samples: Added new SideBySideFormsTablet sample.
  19. ToolBox: Search feature added.

Documentation Changes for Version 1.4.1

  1. TextBox and Input box: These controls had a problem. On iOS devices, they were showing 10 pixels wider than in the Design Screen and on Android devices. The problem was fixed by setting padding:0px in the internal code which creates them. This change will affect the appearance of your programs on iOS devices. It should actually make most of them look better, especially short textboxes and buttons. To go back to the old appearance, you will need to add “padding:10px;” to the style property of the control.

  2. RadioButton: This new control is much improved over the old OptionButton control. While OptionButton will continue to work, its use is discouraged. The new one is much prettier. You can set up all the options in one control, instead of needing a control for each one. It also has a much simpler interface. See the Language Reference for the details.

  3. Forms no longer have to be full screen and you can have more than one open at a time. This allows techniques like side by side forms on tablets (see sample) and pop up dialog boxes.

Ajax made Simple Part 1

Most developers have heard of Ajax by now. Unless you’ve worked with it, you probably think it’s another complicated form of alphabet soup. It actually turns out to be quite easy to use from NS Basic/App Studio.

First, let’s explain what it is (and isn’t). It stands for Asynchronous JavaScript And XML. The good news is that there’s no need to be asynchronous or to use XML – and that NS Basic takes care of the JavaScript.

Ajax makes it easy to exchange data with your server. Think of it as a function you can call that is running on another system. You can pass it parameters and it can return values. Since it’s running on your server, it can do things that you cannot do on your device. It can access files and databases on the server, or get data from other web sites without worrying about Same Origin Policies.

Let’s look at some code. We will have our NS Basic app send the server a string, which the server will return reversed. Here is what the app looks like:

The only code in this app is the “Reverse” button. The Ajaxfunction sends the contents of the top textarea to a PHP script that is running on the server. If it returns successfully, we display what came back. Otherwise, we show the error:

Function btnAjax_onclick()
  req=Ajax("ajax.php/?myText=" & txtSend.value)
  If req.status=200 Then 'success
    txtResponse.value=req.responseText
  Else 'failure
    txtResponse.value="Error: " & req.err.message
  End If
End Function

The PHP script is even easier. It gets the input that is named myText, reverses it, and uses the echo statement to send it back.

<?php
 // Get the data from the client. 
 $myText = $_GET['myText'];
 // Send back the text, reversed
 echo "Data received from Device (reversed): " . strrev($myText); 
?>

Here is the result:

A few notes:

  • The php script needs to be on the same folder on the server as the NS Basic app.
  • Ajax is based on XMLHttpPost.
  • A handy way to return data from your PHP script is in JSON format. PHP even has a handy json_encode() function.

iWebInspector: Debugging on iOS devices

An amazing new product crossed my desk today. iWebInspector lets you open up a debugging session on an NS Basic/App Studio app that is running in the iOS iPhone or iPad Simulator.

It was developed by Max Firtman (who has come up with other innovations that we at NS Basic have used), based on a discovery by Nathan de Vries on how to enable the Remote Web Inspector on iOS 5.

Since the iOS Simulator only runs on Mac OS, this tool requires a Mac. You’ll also need to download Apple’s XCode, which includes the iOS 5 SDK and the Simulator. It’s a 1.6 gig download, but easy to install once it is there. You won’t have to learn XCode or even how to start the Simulator: iWebInspector will take care of that for you.

Here’s how iWebInspector looks when you start it: (this is Beta 0.9 – expect it to get better looking quickly):

If you click on Open iOS Simulator, the Simulator will start automatically. If it is purely a web app, open it in Safari then choose “Load from Safari”. If it has been saved to the Home Screen, start it and choose “Load from webapp”. PhoneGap apps can even be debugged: enter the App name and “Load”.

This tool will be especially useful for debugging apps which can only be tested on a device.

NS Basic/App Studio 1.4.0 released!

Features great new ToolBox!

We’ve completely redone the toolbox. With its folders, it is able to accomodate many more controls than before. Being able to drag and drop onto the Design Screen makes it easier and more natural to use. All new icons make it look great. To top it off, we’ve added new Slider, Date and Time controls.

The URL is the same as before.

Here’s the complete list of what has been changed:

  1. ToolBox: Completely replaced – vastly improved!
  2. ToolBox: All new icons!
  3. ToolBox: Drag and drop controls to Design Screen.
  4. Controls: New Data, DateTime, Month and Time controls. (iOS5)
  5. Controls: New Slider control (iOS5)
  6. ToolBox: Double click adds control to Design Screen.
  7. Code Window: Indentation problem fixed with ‘If’ after a blank line.
  8. Code Window: Recompile of source code improved.
  9. Code Window: Syntax checking is back.
  10. Code Window: Very long statements are handled much better.
  11. Controls: PayPal – New addField() function added.
  12. Controls: PayPal – Subscribe and Unsubscribe added.
  13. Controls: CommandButton is now called Button.
  14. Deploy: Build status screen appearance improved.
  15. Deploy: Unicode characters allowed in configxml.
  16. Docs: Handbook and Language Reference updated.
  17. Docs: Tutorials 1-4 overhauled.
  18. Design Screen: Right click to add control do so at cursor position.
  19. IDE: Added “Reset IDE Panels” to View Menu.
  20. IDE: Control descriptions now appear in the Hints area.
  21. IDE: Format of .nsx file improved for more readability.
  22. IDE: View menu fixed.
  23. Installation: Unicode characters allowed in install path.
  24. Property Box: Spaces in control ID no longer allowed.
  25. Runtime: NSB.InputBox input field sized properly on Safari.
  26. Runtime: NSB.InputBox no longer bounces on Android
  27. Samples: New Slider sample (iOS5)
  28. Samples: DateTime updated to use new controls.
  29. Translator: Integer Divide operator now works (“”)
  30. Translator: VBCritical now parses properly.
  31. Translator: Multiple statements per line using : fixed.

Documentation Changes for Version 1.4.0

  1. The ToolBox has been overhauled. It looks a lot nicer, can scroll (so users with small screens can see all the controls again) and has some new features. To add controls to your project, either drag & drop them or double click.

Building Native Apps

The enhancements in NS Basic/App Studio 1.3.1 make building native apps much easier. First, a bit of background: NS Basic/App Studio is designed to make Web Apps. These apps take advantage of the power of current browsers and HTML5 to make native appearing apps. With the speed improvements of JavaScript in recent years, they have excellent performance. Web Apps can also be compiled into Native Apps, which have their own advantages and disadvantages.

Under the Run menu, there is an option called “Build Native App”. Once you have tested your project, use this option to submit your app to the PhoneGap Build server. The compilers and SDKs to build native apps are large and complex: using a server to perform these operations saves you a lot of grief installing and maintaing them.

Once submitted, you can check the status of the build using “Get Native Build Status” under the Run menu.

Completed builds have their download links listed.

Some useful notes:

  • Each user of PhoneGap Build should have their own account. For demo purposes, NS Basic has a default account, but your files will not be secure there. It’s easy to sign up for your own. Once you have it, enter the information into “Deploy Options” under the Tools menu.
  • The program name and your icon will be taken from your project properties. Other PhoneGap options are set up in the configxml property in your project’s properties. Read more about using config.xml here.
  • iOS will not build until Apple’s signing information has been entered.
  • PhoneGap Build is in beta right now. PhoneGap may start charging for this service at a some point.

NS Basic/App Studio 1.3.1 Released!

NS Basic/App Studio 1.3.1 is ready to download. You can download it from the same URL as before.

Here is what is new and changed:

1.3.1

  1. Deploy: config.xml file now created automatically. See below.
  2. Controls: Adsense – id property added.
  3. Controls: Textarea now has single finger scrolling (iOS 5)
  4. Deploy: PhoneGap Build 404 errors now handled gracefully.
  5. Globals: AppBuildStamp, AppLegalCopyright, AppVersion, NSBVersion added.
  6. IDE: New control: range slider. Part of TextBox. (iOS 5)
  7. IDE: New project property: configxml
  8. IDE: New project property: Version
  9. IDE: phonegap property removed. See below.
  10. Runtime: Buttons no longer have orange flash on Android
  11. TechNotes: New Tech Note 8: Web Apps Compared to PhoneGap Apps

Documentation Changes for Version 1.3.1

  1. Config.xml is a file that PhoneGap uses for its settings: icon, program name, version, features used, etc. Until now, you had to create this file yourself. Now, it is generated automatically using the information already in your project. To customize it for your own needs, edit configxml in Project Properties. Full documentation on config.xml is here.

  2. The phonegap property has been removed from Project Properties. It conflicted with PhoneGap Build and was rarely used. To accomplish the same thing, add <script src="phonegap.js"></script> to the extraheaders property.

  3. Range


    The Range option in the TextBox control allows you to have an input slider. (iOS 5).

NS Basic/App Studio 1.3.0 Released!

NS Basic/App Studio 1.3.0 is ready to download. You can download it from the same URL as before. We will also be sending an email with the address to registered users.

Major new features include:

– PhoneGap Build integrated into IDE
– New Adsense control: make money from ads in your app
– New NSB.MsgBox control: nicer looking, more features
– iOS 5 features: Date, DateTime, Month and Time pickers

As well as lots of other additions and bug fixes!

Here is the complete list:

1.3.0

  1. PhoneGap: Can now create native apps directly in NS Basic/App Studio.
  2. Controls: New AdSense control lets you add advertising to your app.
  3. Language: New NSB.InputBox function
  4. Language: New NSB.MsgBox function
  5. Controls: ComboBox: Complete overhaul, much easier to use. See below.
  6. Controls: Add new Date, DateTime, Month and Time input types for iOS5.
  7. Code Window: ‘is’ and ‘in’ are now treated as a keywords.
  8. Code Window: Search now handles unicode characters.
  9. Code Window: Fixed bug on line continations.
  10. Controls: Menus now refresh automatically when items added or deleted.
  11. Controls: Menus: Scrolling fixed on MenuNumber* controls.
  12. Controls: Menus: several formatting problems fixed.
  13. Deploy: NETWORK: * is default in manifest. See below.
  14. Docs: Handbook and Language Reference updated.
  15. IDE: Amazon Fire screen size added. (see below)
  16. IDE: File name at top of the screen corrected.
  17. Language: New Sort() function – see sample in Folder 3.
  18. Language: Values of vbYes and vbNo changed from true, false to 6,7.
  19. Language: MsgBox returns new values for vbYes and vbNo.
  20. Language: Add encodeURI() and decodeURI() to documentation
  21. Language: Add encodeURLComponent() and decodeURIComponent() to docs.
  22. Runtime: iScroll updated to 4.1.9
  23. Samples: New DateTime sample.
  24. Samples: New Sort sample.
  25. Samples: All web samples have improved manifests.
  26. Samples: FaceBookAPI and GoogleReverseGeocoding should now work.
  27. Samples: Geolocation updated due to change on Google’s server.
  28. Samples: New AdSense sample.
  29. Samples: New nsbMsgBox sample shows MsgBox and InputPrompt.
  30. Samples: LocalStorage enhanced with extreme comments. (Thanks, Alan Heverly!)


Documentation Changes for Version 1.3.0

  1. iOS5: This release brings support for new features in iOS5. Unfortunately, iOS5 has a bug which affects all web apps (not just NS Basic generated ones). It is recorded as Bug 9519157 in Apple’s tracking system. The first time an app is run after it is saved to the Home screen, it will show a message that internet access is required. The message can be ignored: it will only appear once.

  2. PhoneGap Build in NS Basic/App Studio: We have now added the ability to create native apps using PhoneGap directly into NS Basic/App Studio. Here is what you need to do:

    1. If you have a PhoneGap Email and Password, enter it into Deploy Options (under the Tools menu). Otherwise, a demo account will be used.
    2. From the Run menu, choose “Build Native App”.
    3. From the Run menu, check the status of your build in “Get Native Build Status”.
    4. As the builds complete, the URLs to download them will appear on this screen.
    5. Do whatever else you need to do to deploy the native app to the device.
    6. To set additional options for the build, create a config.xml file in your home directory. See https://build.phonegap.com/docs/config-xml.

  3. ComboBox: Now much easier to use, and supports setting up the list in the IDE. Old implmentation should continue to work. See updated sample.

  4. Manifest: NETWORK: * is now part of the default manifest. This means that any external reference is now allowed. This is especially helpful if you are doing complex operations with external servers. If you add your own NETWORK: section to your manifest, it will override the default setting.

  5. New AdSense Control: AdSense lets you put advertising on your page. If your customer clicks on it, your AdSense account at Google will earn money. To use this, first sign up with AdSense.com, then fill the account details into the control’s properties. Note that if the customer clicks on an ad, your program will end and the customer will be taken to the ad’s website. Make sure you keep your current state saved so you can restart.

  6. New NSB.MsgBox control: The current MsgBox statement reads “JavaScript” instead of the program name, and is missing many features found in the VBScript version. The new NSB.MsgBox remedies this – it has all the features of the VBScript statement and more: such as custom icons.

    There is one significant difference. All execution is not stopped until the user responds (as the current MsgBox and the VBScript one do). The screen will lock out all other input, but execution will continue. Once the user has dismissed the NSB.MsgBox, a function in the program can be called to deal with the result.

    See the new nsbMsgBox sample.

  7. New NSB.InputBox control: Implemented much like NSB.MsgBox.

  8. Amazon Fire support: While we support the screensize of the device, we have not actually gotten one to test yet. No promises until we do!

NS Basic/App Studio 1.2.6 Released!

NS Basic/App Studio 1.2.6 is ready to download. You can download it from the same URL as before. We will also be sending an email with the address to registered users.

1.2.6

  1. Samples: Nearly all have been revised and new comments added.
  2. Controls: All scrolling controls now have a refresh() method. See below.
  3. Docs: Handbook and Language Reference updated.
  4. Code Window: ‘Not’, ‘True’ and ‘False’ were not colored correctly.
  5. Code Window: False syntax error on Do statement fixed.
  6. Controls: Form now has some events.
  7. Controls: nsbbutton class improved.
  8. Controls: Remove href=”#” tags – fixes refresh problem.
  9. Deploy: Incorrect browser message can be changed.
  10. Language: New global: Location. See Language Reference.
  11. Samples: New Picturebox_ScrollAndZoom sample.
  12. Samples: Reorganized folders.


Documentation Changes for Version 1.2.6

  1. Scrolling controls: All now have a .refresh() method, which replaces having to do SetTimeout(control_ref.refresh(),100). Now you just need to do control.refresh() after the content of a scrolling area is rendered or updated.