What does “useStrict” do?

AppStudio 6 introduces a new project property called useStrict. It catches a number of previously non fatal errors in your code and gives error messages.

Here’s an example. If you have the following code:

a = "george"

where a has not been defined, you will get an error with useStrict set to True. There is no error if it is False. UseStrict forces you to have better code.

The solution is to declare the variable before use, using Dim for BASIC and var for JavaScript.

Dim a    ' BASIC
var a;   // JavaScript
a = "george"

Caution: If you turn useStrict on with an existing project, you need to do a complete retest of every part of your project. It will throw errors in code which worked before.

Here is a list of issues found by useStrict:

  • Disallows global variables. (Catches missing var declarations and typos in variable names)
  • Silent failing assignments will throw error in strict mode (assigning NaN = 5;)
  • Attempts to delete undeletable properties will throw (delete Object.prototype)
  • Requires all property names in an object literal to be unique (var x = {x1: “1”, x1: “2”})
  • Function parameter names must be unique (function sum (x, x) {…})
  • Forbids octal syntax (var x = 023; some devs assume wrongly that a preceding zero does nothing to change the number.)
  • Forbids the with keyword
  • eval in strict mode does not introduce new variables
  • Forbids deleting plain names (delete x;)
  • Forbids binding or assignment of the names eval and arguments in any form
  • Strict mode does not alias properties of the arguments object with the formal parameters. (i.e. in function sum (a,b) { return arguments[0] + b;} This works because arguments[0] is bound to a and so on. )
  • arguments.callee is not supported
  • Keywords are checked, including some new ones: implements, interface, let, package, private, protected, public, static, and yield.
Posted in tips | Comments Off on What does “useStrict” do?

The future of nsbapp.com

When we released the first version of AppStudio in 2010, we realized our users would need a test server for their apps. We created nsbapp.com for this purpose.

Seven years later, almost everything has changed in AppStudio, sometimes more than once, to keep up with constantly evolving web technology. With AppStudio 6, we introduced Volt, our new server. It replaces nsbapp.com in its role as a test server, and does much more.

The operating system which nsbapp.com runs on obsolete. As of April 30, it will no longer receive security patches. Without those, it becomes a danger to its users and the internet. We need to retire it.

This will not affect anyone who has upgraded to AppStudio 6. However, there are still a few dozen people with older versions of AppStudio who are actively using nsbapp.com. If you are using an older version, AppStudio will still work after April 30. You will need to deploy to your own server: nsbapp will no longer be available.

If you have concerns, please contact us at support@nsbasic.com. We will be glad to help.

Posted in news | Comments Off on The future of nsbapp.com

AppStudio 6.1.2.1 released!

We’re pleased to announce AppStudio 6.1.2.1 is ready. It fixes a couple issues:

1. Google updated Chrome to version 56 in the past few days. It affects how scrolling works on Android devices, particularly with the Common Grid. AppStudio’s scrolling is handled by the iScroll Library. An update to that library seems to resolve the issues.

2. Apps using Bootstrap controls with icons did not run in offline mode. The problem was that the icon files were being loading dynamically. They have now been made part of the core files, so they can be cached.

If you notice any issues after these changes, please let us know right away.

Download the latest version from ‘Check for Updates’ under then AppStudio Help menu. It is a free upgrade for AppStudio 6 users and subscribers.

Posted in news | Comments Off on AppStudio 6.1.2.1 released!

AppStudio 6.1.2 released!

We’re pleased to announce AppStudio 6.1.2 is ready. New and improved stuff includes:

  1. About_Screen: Shows current subscription status
  2. Code Window: Fix problem with displaying function names.
  3. Controls: Bootstrap Input and Textarea can now set focus.
  4. IDE: Subscription status checked on startup – will give warning if expiring.
  5. Volt: 7 day grace period on expired subscriptions.
  6. Volt: Improve error message on bad password.

Download the latest version from ‘Check for Updates’ under then AppStudio Help menu. It is a free upgrade for AppStudio 6 users and subscribers.

Posted in news | Comments Off on AppStudio 6.1.2 released!

Subscriptions Update

The AppStudio 6 Upgrade includes a bonus free subscription: 4 months if paying by PayPal, 120 days if paying by credit card. The subscription gives you a few nice things:

  1. Use of Volt Services, including
    • App Hosting
    • User Management
    • serverStorage and appStorage
    • Adsense
    • Custom Domains
    • Credit Card payment processing
  2. No charge for future major releases of AppStudio
  3. A special rate of $9.95/month (regularly $15.00)

If you bought the AppStudio upgrade when it came out, you will start getting charged this month. If you want to change your subscription level to Free or Pro, you can do so using the Subscription Manager.

There are 3 subscription levels:

  1. Free: Apps hosted on Volt Server for testing only, limited time.
  2. Essential: Volt Sevices and free upgrades. This is what came with the upgrade.
  3. Pro: Essential, plus Premium Support.

If you have any questions about your subscription, please contact us right away at support@nsbasic.com. We’ll be happy to help!

Posted in news | Comments Off on Subscriptions Update

Using appStorage to save App-level Data

Previously, we looked at serverStorage, which allows you to save data from your app on the Volt server instead of on the device. serverStorage is saved for the user of the app – other users cannot look at it.

appStorage is data which is shared by all the users of the app. Some possible uses are:

  • A product list, with the latest prices and availability.
  • A message to all users.
  • A table with the latest tax rates or exchange rates.

appStorage works just like serverStorage. It has the same functions. The big differences are that all users of the app see the exact same data, and only Dashboard apps can modify it.

Regular users of the app can use getItem() and getAllItems.

The function clear(), removeItem() and setItem() can be used if the following two conditions are met:

  1. Dashboard Access in Project Properties is set to true.
  2. The name used to sign into the app is the same as the name used to upload the app to Volt.

To use these functions, there is an additional 3rd parameter with the VoltID of the app whose appStorage is to be changed:

appStorage.setItem("SimpleString", "ABCD", "XxXxXx", done);

Dashboard apps include the Dashboard itself, as well as apps which have Volt Dashboard Access project property set to True. You can check NSB.voltDashboardAccess at runtime to see if Dashboard access is enabled.

This is a powerful features, but it should be used wisely. Set Volt Dashboard Access to false for your users so they only read the data in appStorage. If you have an app which creates and changes data for them, do so in a separate app with Volt Dashboard Access set to true.

Posted in tips | Comments Off on Using appStorage to save App-level Data

AppStudio 6.1.1 released!

We’re pleased to announce AppStudio 6.1.1 is ready. New and improved stuff includes:

  1. Preferences: New checkbox “Deploy on save?”. In Advanced tab.
  2. Preferences: New “SFTP Key” field. Allows use of RSA private key for deployment.
  3. Project Properties: New “DashboardAccess” property adds ability to access your user’s Volt data.
  4. Controls: Bootstrap Select now has text property which returns selected text.
  5. Controls: Rel option on YouTube control fixed.
  6. Samples: SignOn samples were reversed.

Download the latest version from ‘Check for Updates’ under then AppStudio Help menu. It is a free upgrade for AppStudio 6 users.

Posted in news | Comments Off on AppStudio 6.1.1 released!

Volt: Accessing serverStorage from the Dashboard

When you use serverStorage, the data is saved on the Volt Server. The Dashboard is your tool to manage the apps you have saved on Volt. One of its features is that you can examine and change the data in serverStorage.

Here’s how.
Continue reading

Posted in tips | Comments Off on Volt: Accessing serverStorage from the Dashboard

Using serverStorage to save data on the Volt Server

AppStudio 6.1 brings a new Volt feature: serverStorage. It lets you save and retrieve data on the Volt server. Here are a few uses:

  • As a backup: Keep critical data in the server, so if the phone gets lost or damaged, information is not lost.
  • Multiple devices: If the user runs your app on multiple devices (desktop included), your app can pick up where it left off with the same data.
  • Support: As the owner of the app, you can examine what is in your user’s serverStorage.
  • Data Sharing: The owner of the app can read and write to users’ serverStorage using a different app. Use this to send specific information to users, or to get data the user has collected.

It’s easy to use. You save and retrieve values using a named key. The values can be of any data type: numbers, strings, arrays or objects. There are no limits on the number of values you keep, nor how big the values can be, other than that they be reasonable. If you need to use a lot of data, check with us at support. Here are some examples:
Continue reading

Posted in news, tips | Comments Off on Using serverStorage to save data on the Volt Server

Using the Clipboard

ClipboardData lets you access the data on the Clipboard. You can:

  • Use and modify the data cut or copied to the clipboard
  • Use and modify data pasted from the clipboard.

It can be used in Input, Textarea and Textbox controls in all frameworks. It controlled by the oncopy, oncut and onpaste events. The information about the clipboard is passed as a parameter to these events.
Continue reading

Posted in tips | Comments Off on Using the Clipboard