Advanced Component
  • 13 Feb 2023
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Advanced Component

  • Dark
    Light
  • PDF

Article summary

The Advanced component consists of blocks that perform specific actions.

Try Catch Finally

  • The Try statement lets you test a block of statements for errors.
  • The Catch statement lets you handle the error. The catch statement has an inbuilt error variable that can be used for diagnosing.
  • The Finally statement lets you execute code, after trying and catching, regardless of the result.
Block LayoutGenerated Output
TryCatch
function er_82dd5cda_4b05_447c_a856_6d43bb829825_onPageShow(e,obj,index){
   try{

  }
   catch(err){

  }
  finally {
  }
}

Regular Expression

Regular Expressions are patterns useful for efficient text processing. A regular expression can be matched, tested, or executed by specifying the expression path and input values.  

InputOutputBlock LayoutGenerated Code

Choose the type of Text matching from the dropdown list(match, test, exec) 

Regex format as a variable or Text - input-1, 

Input data as a variable or Text - input-2


For match: returns matching text else null, 

For test: returns true or false, based on the result, 

For exec: returns the found text as an object else null.


 
__er.regularExpression("test", /expression/g, 'input');

Set Timeout

This block calls a function or any code block after a number of milliseconds.

InputOutputBlock LayoutGenerated Code

Time in milliseconds as a variable or number - input-1 

Function or code as a statement block.


Returns a number, representing the ID value of the timer that is set.



SetTimeout
setTimeout(async function(){}, 0);

Set Interval

This block executes any code block repeatedly for the specified interval time(in milliseconds).

InputOutputBlock LayoutGenerated Code

Time in milliseconds as a variable or number - input-1, 

Function or code as a statement block.

NA


SetInterval
setInterval(async function(){}, 10);

Set Timeout

This block calls a function or any code block after a number of milliseconds. This block can be set to a variable(using a set block) and the variable can be used to cancel the timeout period.

InputOutputBlock LayoutGenerated Code

Time in milliseconds as a variable or number - input-1 

Function or code as a statement block.


Returns a number, representing the ID value of the timer that is set.


Settimeout-oval
settimeout-settovariable
var item;


async function er_1674710886_click(e,obj,index){
   item = setTimeout(async function(){}, 0);

}

Set Interval

This block calls a function or any code block at specified intervals(in milliseconds). This action block can be set to a variable(using a set block) and the variable can be used to cancel the interval period.

InputOutputBlock LayoutGenerated Code

Time in milliseconds as a variable or number - input-1, 

Function or code as a statement block.


Returns an interval object


setinterval-oval
setinterval-settovariable
var item;


async function er_1674710886_click(e,obj,index){
   item = setInterval(async function(){}, 10);

}

Clear Interval

The Clear Interval block clears a timer set with the setInterval block.

InputOutputBlock LayoutGenerated Code

The  ID value of the timer as variable or number.


Clears a timer set with the set Interval block using interval id.


ClearInterval
clearInterval();

Clear Timeout

The Clear Timeout block clears a timer set with the Set Timeout block.

InputOutputBlock LayoutGenerated Code

The  ID value of the timer as variable or number.


Clears a timer set with the set timeout block using timeout id.


ClearTimeout
clearTimeout();

JSON Parser

The JSON Parse String block is used to parse a JSON string which is written in a JSON format and it returns a JavaScript object.

InputOutputBlock LayoutGenerated Code

JSON value as variable or Text.


Returns JSON Object corresponding input text JSON.


JSONParse
__er.parseJSON('{}');

JSON Stringify

The JSON Stringify block takes in a variable or object as an input and converts it into an equivalent string.

InputOutputBlock LayoutGenerated Code

JSON Object as variable or Object value.


Returns Text JSON corresponding to the input JSON Object.


JSONStringify
__er.JSONStringify()



Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence