This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /** | |
| * Add Logic | |
| * The Add() is used to add two numeric constants. | |
| */ | |
| VAR @number1, @number2, @results | |
| SET @number1 = 1 | |
| SET @number2 = 2 | |
| SET @results = Add(@number1,@number2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /* Insert Comment Here */ | |
| VAR @string1 | |
| SET @string1 = "Hello" | |
| /** | |
| * Insert Comment Here | |
| */ | |
| VAR @string2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /* script goes here */ | |
| VAR @string | |
| SET @string = "hello world" | |
| ]%% | |
| <p>%%=Uppercase(@string)=%%</p> | |
| <!-- Example Output --> | |
| HELLO WORLD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /* script goes here */ | |
| VAR @string | |
| SET @string = "Hello World" | |
| ]%% | |
| <p>%%=v(@string)=%%</p> | |
| <!-- Example Output --> | |
| Hello World |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /** | |
| * Declaring & Setting Variables | |
| * Below is an example how to declare and set variables with AMPscript. | |
| */ | |
| VAR @FullName | |
| SET @FullName = "John Doe" | |
| ]%% | |
| <p>Hi %%=v(@FullName)=%%, your shipment has arrived!</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /** | |
| * Attributes & Data Extension Values | |
| * Below is an example how you can use attributes to personalize your email. | |
| */ | |
| VAR @Birthdate, @FirstName | |
| SET @Birthdate = [Birthdate] | |
| SET @FirstName = [FirstName] | |
| ]%% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /** | |
| * Constant (String Values) | |
| * A string is a set of one or more letters, numbers, spaces or special characters. These constant values must be surrounded (delimited) by double or single quotes. They can also include the same type of delimiting quote inside by doubling it. | |
| */ | |
| VAR @string1, @string2, @string3, @string4 | |
| SET @string1 = 'String text goes here' | |
| SET @string2 = "String text goes here" | |
| SET @string3 = "My string's inside quotes!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /** | |
| * Constant (Numeric Values) | |
| * Numeric constant values consist of one or more digits. They are formatted as unquoted numerals. They can include 1 decimal point and an introductory minus sign for negative numbers. Commas, are not permitted. | |
| */ | |
| VAR @number1, @number2, @number3 | |
| SET @number1 = 123 | |
| SET @number2 = -123 | |
| SET @number3 = 123.456 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /** | |
| * Constant (Null Values) | |
| * etaphysical. | |
| */ | |
| VAR @string1, @string2, @string3, @string4 | |
| SET @string1 = "String1 Copy Here" | |
| SET @string2 = "" | |
| SET @string3 = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Example Code --> | |
| %%[ | |
| /** | |
| * Constant (Boolean Values) | |
| * Boolean constant values must use the words true or false. They are not surrounded by quotes. They are also NOT case sensitive. | |
| */ | |
| VAR @toggle1, @toggle2, @toggle3, @toggle4, @toggle5, @toggle6, @toggle7, @toggle8 | |
| SET @toggle1 = true | |
| SET @toggle2 = false | |
| SET @toggle3 = True |