This is a detailed list of changes in CSPro 8.1. For a more general overview, see the readme.txt file located in the CSPro installation folder.
A feature showcase demonstrating some of CSPro 8.1's new features is available on
GitHub.
- CSPro is now open source! The source code, written primarily in C++, JavaScript, Java/Kotlin, and PHP, with some code written in C#, is available on GitHub: github.com/csprousers.
- Markdown can be used while specifying question text, in templated reports, and can be viewed (as generated HTML) using the view function or in CSView. Markdown can also be edited in CSCode and included as part of CSPro Documents.
- Applications can now incorporate JavaScript in addition to CSPro logic. Many open source JavaScript libraries exist that can be brought into your application, and as a dynamically typed language, some programming tasks may be easier using JavaScript. By using the JS namespace, it is possible to evaluate JavaScript, invoke functions, and convert CSPro symbols to JavaScript numbers, strings, arrays, and objects. It is also possible to create function wrappers in CSPro logic that appear as user-defined functions but call into JavaScript when invoked.
- Images in the WebP format can be loaded and saved using the Image object and can be used as value set images.
- A new dialog, Manage Application Files, replaces the Add Files and Drop Files dialogs, providing a central place to manage an application's files and each file's properties. New properties include:
- The CSPro Settings dialog has been renamed Manage Credentials and now allows for the granular clearing of synchronization, data, and location credentials.
- Numeric value sets can be generated in descending order.
- CSEntry can be launched using a deep link that starts with "https://csprousers.org/pff". CSEntry runs the application specified as part of the deep link's path.
- A new mapping property allows Leaflet to be selected as the mapping engine for Android. On Windows, Leaflet is the only available mapping engine.
- Offline maps can now use ArcGIS Tile Packages that use the CompactV2 storage format (with the file extension .tpkx).
- When using Leaflet, ArcGIS Tile Packages created using the Mixed tile format ("JPEG in the center of the package with PNG 32 on the edge of the package") are supported.
- Leaflet mapping supports using HTML tags in text entries for functions such as Map.setTitle and Map.setMarkerText. (This was already possible when using the Google Maps mapping engine.)
- Question text can be defined using Markdown. The Markdown is rendered as HTML for display.
- The default format for new question text can be specified, and the editor's toolbar displays the format with four options. The first two options,
and
, are the HTML-based options that previously existed. A new option,
allows for the specification of question text as a HTML text template, supporting <? ?> template expressions. This HTML is edited as code with no visual editor. The final option,
, is for Markdown question text. - When using formatting options, or adding images or hyperlinks, the question text editor will use the correct syntax based on whether the question is using HTML or Markdown.
- To toggle between question text and help text, the editor's toolbar now contains two buttons:
for question text and
for help text. - You can view a preview of question text by pressing Ctrl + F5 or selecting Preview Text Template from the View menu. This will not run the CSPro logic, so the preview will not necessarily look complete, but it can be useful to view an approximation of how the rendered question text will appear.
- The QSF logic object gives access to the StringWriter in use when processing question text as a text template.
- A new namespace, JS, contains functions that facilitate executing JavaScript from within CSPro logic. Functions in the namespace include: JS.eval, JS.getValue, JS.getValueJson, JS.hasValue, JS.invoke, JS.setValue, and JS.setValueFromJson.
- The new keyword declare can be used to declare a user-defined function. The declared function can be referenced in logic prior to its definition. Using a function prior to its definition was previously possible only using workarounds such as invoke or function pointers.
- A new object, StringWriter, supports building strings incrementally. The Report object is a kind of StringWriter, and the QSF special name, used when processing question text, is also a kind of StringWriter. A StringWriter has the functions: clear, toString, write, writeEncoded, writeEncodedLine, and writeLine.
- The Report object implements three new functions, inherited from its StringWriter parent: writeEncoded, writeEncodedLine, and writeLine.
- The encode function supports encoding to Markdown format.
- The EXIF data of an image can be queried using the Image.getExif function. EXIF data in a JPEG can include useful information such as the date and time when a photo was taken, as well as GPS coordinates.
- The Image object can now load icon files (.ico) on Windows and can save to that format on all platforms.
- Images used by the Map.addImageButton and Map.setMarkerImage functions can be specified as URLs pointing to local resources (using localhost URLs) or to remote servers.
- If an Array object is defined with initial values and is also marked as a saved array, the initial values will only be used if the array does not exist in the saved array file.
- The Symbol.updateValueFromJson function has been renamed Symbol.setValueFromJson, though the old name will remain as an alias for some time.
- JavaScript files can be associated with applications by using the Manage Application Files interface. The JavaScript can be evaluated as a global script or as a module.
- Functions in the JS namespace allow interaction with JavaScript using CSPro logic:
- JS.eval: Evaluates JavaScript in the global execution context.
- JS.getValue: Converts a JavaScript variable or property to its CSPro equivalent.
- JS.getValueJson: Returns the JSON representation of a JavaScript variable or property.
- JS.hasValue: Returns whether a JavaScript variable or property is defined (not undefined).
- JS.invoke: Executes a JavaScript function that exists in the global execution context with any CSPro arguments converted to their JavaScript equivalents.
- JS.setValue: Converts a CSPro variable to its JavaScript equivalent and adds this as a variable to the global scope, or sets an object's property.
- JS.setValueFromJson: Create a JavaScript variable using JSON and adds it as a variable to the global scope, or sets an object's property.
- A new action, throwException, throws an exception in the current execution environment.
- A new action, System.createShortcut, creates a shortcut to a CSPro application or file. The shortcut is placed on the Windows Desktop, or on the Android launcher.
- The UI.closeDialog action has been renamed UI.close, though the old name will remain as an alias for some time. A new argument allows the HTML dialog or web view to be closed without a valid result but instead with an exception that is thrown in the execution environment that launched the dialog or web view.
- A new action, UI.setWebViewOptions, sets options for the current web view. These options include allowing access to a device's camera, geolocation, and microphone.
- The JSON format of exceptions has changed from a string to an object with message, name, and cause properties.
- SQLite in-memory databases can be opened using Sqlite.open by specifying ":memory:" as the name.
- The version of SQLite included with CSPro now supports mathematical functions such as atan2 and sin.
- Binary data can be cached, an optimization useful when binary data will be used by multiple actions.
- Resource IDs, such as those used by the Sqlite namespace's actions, do not need to be specified when they can be calculated implicitly.
- The Sqlite namespace's database resource ID argument is now named dbId. The old name, db, will work in CSPro 8.1 but not in future versions.
- The Logic.updateSymbolValue action has been renamed Logic.setSymbolValue, though the old name will remain as an alias for some time.
- The Compare Data tool will match duplicate cases by UUID when running a comparison in indexed order. Additionally, comparing cases in sequential order now works properly with data sources with duplicate cases.
- The Paradata Concatenator and paradata function's concatenation routines have been optimized, improving performance when processing many paradata logs.