Skip to main content

The Basics

Last updated 17/07/2023

Five's Code Editor is for you to add the code required for your application. Unlike the Code Editor in the Functions view, multiple tabs can be open at once enabling you to have access to more than one code block at a time.

Learn to Use the Basics in Five's Code Editor



Add a Function

1. Click the Add New Code button.


Add New Code Button
Figure 1 - Add New Code button


2. Type an ID in the Function ID field.

tip
JavaScript is the default language, you can change this by clicking the lookup icon in the Language field and selecting another language!

3. Click the OKAY button.


Add a Function
Figure 2 - Add a function

tip
Five automatically creates the template for your function as shown below!

GetPrice()
function GetPrice(five, context, result)  {
return five.success(result);
}

4. Type your code.


Add Your Code
Figure 3 - Add your code

Save a Function

1. Click the Save Current Tab button.


Save Current Tab Button
Figure 4 - Save Current Tab button

danger
If the tab is displaying a circle, your code is not saved.

Add Multiple Functions

1. Click the Add New Code button.


Add New Code Button
Figure 5 - Add New Code button


2. Repeat the steps above for Add a Function.


Add a Function
Figure 6 - Add a function

info
Your function will open in a new tab.

New Tab
Figure 7 - New tab

Save Multiple Tabs

1. Click the Save All Tabs button.


Save All Tabs Button
Figure 8 - Save All Tabs button

Move Between Tabs

1. Click on each of the tabs.


Tabs
Figure 9 - Tabs

Open an Existing Function

1. Click the Open Existing Function button.


Open Existing Function Button
Figure 10 - Open Existing Function button


2. Click the lookup icon in the Function ID field.


Function ID Field
Figure 11 - Function ID field


3. Select the required Function ID.


Select the Function ID
Figure 12 - Select the Function ID

info
Your code will open in a new tab.

Code
Figure 13 - Code

Cancel Changes

1. Click the Cancel button in the opened tab.


Cancel Button
Figure 14 - Cancel button

2. Click the Yes button.


Yes Button
Figure 15 - Yes button

info

All changes will be cancelled and the code block will be removed from the Code Editor.