Shared Action: TrimString

MINI LESSONS ›› Actions Editor ›› Shared Actions ›› Library ››

MINI LESSON

For general information on what a Shared Action is, and how they are used within ToolBook, click here.


TRIMSTRING

This Shared Action (from a collection of pre-written Shared Actions) will is very similar to the OpenScript function ASYM_Trim. It requires only one parameter - the string you wish to trim. It will return the same string but with leading and trailing Spaces removed.


For example, perhaps you have a field in your ToolBook lesson which asks the user to type in their name. You plan on putting that value into a variable for later use elsewhere in your lesson.


Let's assume the user types:


  "  John Doe    "


these extra spaces could cause display problem when you later try to show this value.


This Shared Action will permit you to trim off any leading and trailing spaces to result in just the actual text of:


  "John Doe"




Example of how to call this Shared Action from within your own Actions Script:


   


The Execute Shared Actions line of code has a full Property Editor that you can use to specify the values for the various parameters required by the Shared Action.


To access it:


  1. Select the Execute Shared Actions line of script in your code
  2. Click the Properties button in the Toolbar


The properties dialog will allow you to specify which values will be passed into this Shared Action and which variable will be used to receive the resulting return value.


 


DOWNLOAD INFORMATION

For general information on what a Shared Action is, and how they are used within ToolBook, click here.



TrimString Shared Action



Created with the Personal Edition of HelpNDoc: Full-featured Kindle eBooks generator