Why did the cookie go to the doctors office? Because he was feeling crummy.

How to code a Zoho chatbot in deluge

intro of how to code a zoho chatbot in deluge

Right now, you may not know what the words variable, boolean, string, conditionals, or integer mean in a programming context. But don’t let that intimidate you. These terms are a lot more straightforward than you might assume. Plus, since they’re used in many programming languages, the things you learn here could be relevant if you continue learning about programming beyond Deluge scripting. Let’s jump into defining these terms so we can get you writing some Deluge! This is how to code a zoho chatbot in deluge.

Syntax

When speaking English, we structure our sentences with syntax so people can understand what we’re saying. For example, if we were eating dinner and asked someone to pass the potatoes, we wouldn’t say: “The pass potatoes please.” That would be incorrect syntax. Programming languages use syntax in a similar way to English. The commands that you write in Deluge need to be properly structured for Creator to understand what you want it to do. Its important to remember that while computers are extremely good at following directions, they can only follow directions that are perfectly written. Whereas most English speakers can make sense of the incorrect syntax, “The pass potatoes please,” computers cannot. Therefore, the most important part of learning a programming language is the syntax. Creator makes learning Deluge easier than learning other programming languages on your own. This ebook will teach you Deluge, but Creator will also assist you as you write your scripts.Deluge or Data Enriched Language for the Universal Grid Environment as we call it, is an online scripting language integrated with Zoho Creator. It enables users to add logic to the application, incrementally, making it more powerful and robust. The entire database layer is abstracted and you will only speak in terms of forms and fields, while scripting in Deluge. A HR manager who wants to create a recruitment application, a home maker who wants to keep track of her monthly expenses, a sales guy who wants to keep track of his leads can all code very easily using Deluge. And a techie who slogs all day creating a web app using conventional tools would be just amazed at how fast it is to do the same using Deluge.

To mention a few powerful applications you can create with Deluge – Library Manager, Recruitment application, Inventory Management and more. The Deluge Script Builder provides a drag-and-drop user interface to add Deluge scripts without the need to learn or remember the Deluge syntax and functions. It helps in creating Deluge scripts quickly, without any errors So when coding a Zoho chatbot in deluge you need to constantly debug the system.

Variables

Put simply, variables are used for data storage. Variables store and manipulate the data attributed to them. A metaphor can make this clearer. The glass cup below holds whatever you put into it. Similarly, a variable stores whatever data you assign to it.To store data in a variable, or declare a variable, you have to write with a specific syntax. “Declaring a variable” is the phrase used in most programming languages for creating a variable and storing something inside it. Let’s see some examples.

variable_name = “value”

; juice_glass = “lemonade” ;

soda_glass = “root beer” ; 

 milk_glass = “whole milk” ;

variable name: it’s important to name your variable something that indicates what its purpose is. In this case, I’ve named them according to the type of juice that is stored in them. All of our variable names have underscores because if you add a space, Creator will get confused and think you’re talking about two different variables. 

; and =: these are part of Deluge’s syntax. The = is used to tell Deluge that the data stored in the variable name is equal to the value given. The ; is used like a period at the end of a sentence. It signals the end of a statement.

value: this is what we’ve inserted into each variable. The data in a variable is called its value.

Now that we know how variables are declared, let’s flesh out the concept a little bit more and get into understanding the types of data you can store in a variable.

Data types

Deluge has five main data types, and Creator treats each one differently. Deluge has additional, more advanced data types like lists and maps, but we’ll cover those in other guides. Below are the five main data types.The first time you declare a variable, you’re telling Creator what data it’s storing and what type of data it should always store. A variable’s value can change multiple times, but its data type won’t change unless you use a special function. If this seems confusing, remember the drinks metaphor that we used. You could declare a variable as a juice variable, and then change the value of the variable as many times as you want. The value could change from orange juice, to cranberry juice, and then to apple juice. However, you could not change the juice variable to a soda variable. To change a juice variable to a soda variable would require using a special function. Now let’s go through a few examples, where you can guess which data type is being displayed. On How to code a zoho chatbot in deluge

Guess the Data Type

Type your answer in the comments below

1: x = “15 Years”; 

2: x = “15”;

3: x = 15;

4: x = 15.0;

5 x = “true”;

6: x = true;

Operators

Operators are difficult to define without the use of common programming jargon. Operators are characters that let you manipulate or compare two values. This is a lot easier to grasp with examples. There are three main kinds of operators, but for now we’ll focus on arithmetic operators, which are used for writing equations. We’ll cover the other types of operators later in this guide.Arithmetic operators should look familiar to you. / is for division and * is for multiplication. % isn’t used as often. % gives you the remainder when you divide the number on the left by the number on the right. The + operator is special because it can be used with text as well as with numbers. The + operator lets you combine a few pieces of text together to create one longer piece. When you start using variables in equations, you’ll see that a variable’s value can change multiple times in one script. Here’s an example.In the beginning of this script, the variable a equals 3. After adding another variable to it, variable a equals 5. Creator reads your scripts one line at a time. This means that when you change a variable’s contents, it will only affect that variable moving forward. Previous instances of it won’t be altered. Since variables contain different data at different times, it can be tricky to find mistakes in a long script. The info and alert commands let you see a variable’s contents. By placing the info command at different places in your script, you can see what information is stored in a variable at different points in time. This process is called debugging because it helps you find mistakes, or bugs, in your scripts. This is important when coding a zoho chatbot in deluge.

Conditionals

Conditionals give your applications the power to react differently depending on how people use them. Conditionals, also called control statements, are like sets of instructions. It’s easiest to think of them as if, then statements: if x happens, then do y. They’re called conditionals because they tell Creator to check if a condition has been met before running the next step in your script.

There are three main conditionals:

1. If statements – These tell Creator how to act if a certain condition is met. Any script that includes conditionals must have at least one if statement.

2. Else if statements – When the condition in an if statement isn’t met, you can tell Creator to check for other conditions using else if statements. This can be useful when you need to tell your application what to do in several different scenarios. If you write out what your Deluge script does in English, an else if would be like the word otherwise: If condition one is met, then do x. Otherwise, if condition two is met, then do y. When you put multiple else if statements in a row, Creator will only run the script from the first one whose conditions are met.

3. Else statements – Else statements tell Creator how to act if none of the conditions from your if statements or your else if statements have been met. Else statements don’t include conditions. When you write conditional statements, the condition you’re looking for always goes inside parentheses. You don’t need any semicolons in the part where you write your condition.The script that runs when the condition is met goes inside curly braces.

 

Writing Conditions

Before Creator runs the script in a conditional statement, it will check if the statement’s condition has been met. In programming parlance, we say that a condition is true (or evaluates to true) if it has been met. If a condition isn’t met, then it is false and the script inside your statement’s curly braces won’t run. To tell Creator what conditions to look for, use relational operators and logical operators.

Outro

That is the basic overview of coding in deluge for more on coding read one of my other blogs.At Artificial programmers.com