Tutorial by Examples

You can use the filter property to retrieve a subset of values from CRM. In this example only the accounts where the company name equals CompanyName are returned. $.ajax({ url: Xrm.Page.context.getClientUrl() + '/api/data/v8.0/accounts?$filter=name eq CompanyName', headers: { 'A...
It is possible to write a method on a generic type that is more restrictive using where sentence. extension Array where Element: StringLiteralConvertible { func toUpperCase() -> [String] { var result = [String]() for value in self { result.append(String(value).upperca...
PROGRAM zhello_world. START-OF-SELECTION. WRITE 'Hello, World!'. Instead of printing to the console, ABAP writes values to a list which will be displayed as soon as the main logic was executed.
ABAP Classes can be declared Globally or Locally. A global class can be used by any object within the ABAP repository. By contrast, a local class can only be used within the scope it is declared. CLASS lcl_abap_class DEFINITION. PUBLIC SECTION. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS...
Class implementation: CLASS lcl_abap_class DEFINITION. PUBLIC SECTION. METHODS: constructor, method1. PROTECTED SECTION. PRIVATE SECTION. METHODS: method2, method3. ENDCLASS. CLASS lcl_abap_class IMPLEMENTATION. METHOD constructor. &q...
Class implementation: CLASS lcl_abap_class DEFINITION. PRIVATE SECTION. METHODS method1 IMPORTING iv_string TYPE string CHANGING cv_string TYPE string EXPORTING ev_string TYPE string. ENDCLASS. CLASS lcl_abap_class IMPLEMENTATION. METHOD m...
Class implementation: CLASS lcl_abap_class DEFINITION. PRIVATE SECTION. METHODS method1 RETURNING VALUE(rv_string) TYPE string. ENDCLASS. CLASS lcl_abap_class IMPLEMENTATION. METHOD method1. rv_string = 'returned value'. ENDMETHOD. ENDCLASS. Method call example: ...
Sometimes loop condition should be checked in the middle of the loop. The former is arguably more elegant than the latter: for (;;) { // precondition code that can change the value of should_end_loop expression if (should_end_loop) break; // do something } Alternati...
CMake knows several build types, which usually influence default compiler and linker parameters (such as debugging information being created) or alternative code paths. By default, CMake is able to handle the following build types: Debug: Usually a classic debug build including debugging informa...
my_vector = [0, 2, 1, 3, 9]; for i = 1:numel(my_vector) my_vector(i) = my_vector(i) + 1; end Most simple things done with for loops can be done faster and easier by vectorized operations. For example, the above loop can be replaced by my_vector = my_vector + 1.
Controls that can be bound with data can make use of SqlDataSource controls. The SqlDataSource control not only allows you to retrieve data from a database, but also edit and sort the data. Retrieving Data Stored Procedure: <asp:SqlDataSource ID="SqlDataSourceEmployees" runat=&q...
Type type = obj.GetType(); //To restrict return properties. If all properties are required don't provide flag. BindingFlags flags = BindingFlags.Public | BindingFlags.Instance; PropertyInfo[] properties = type.GetProperties(flags); foreach (PropertyInfo property in properties) { Console...
You can add an interpreter directive (shebang) to your script. Create a file called hello_world.rb which contains: #!/usr/bin/env ruby puts 'Hello World!' Give the script executable permissions. Here's how to do that in Unix: $ chmod u+x hello_world.rb Now you do not need to call the Ru...
When is an IEnumerable<T> a subtype of a different IEnumerable<T1>? When T is a subtype of T1. IEnumerable is covariant in its T parameter, which means that IEnumerable's subtype relationship goes in the same direction as T's. class Animal { /* ... */ } class Dog : Animal { /* ... */ }...
This program uses the Windows API (WinAPI) to print "Hello World" into a message box. To include a dependency (like Windows in this case), add the uses block including a comma-separated list of units ending with an semicolon. program HelloWorld; uses Windows; begin MessageBox...
A single case discriminated union is like any other discriminated union except that it only has one case. // Define single-case discriminated union type. type OrderId = OrderId of int // Construct OrderId type. let order = OrderId 123 // Deconstruct using pattern matching. // Parentheses used...
To document a function, it is often helpful to have an example script which uses your function. The publish function in Matlab can then be used to generate a help file with embedded pictures, code, links, etc. The syntax for documenting your code can be found here. The Function This function uses ...
These are the most common ways to create an instance of Guid: Creating an empty guid (00000000-0000-0000-0000-000000000000): Guid g = Guid.Empty; Guid g2 = new Guid(); Creating a new (pseudorandom) Guid: Guid g = Guid.NewGuid(); Creating Guids with a specific value: Guid g = n...
Prerequisite: Installing Gradle Once you have Gradle installed, you can setup a new or existing project by running cd $PROJECT_DIR gradle init --type=java-library Note that there are other project types like Scala you can get started with, but we'll use Java for this example. You will end up ...
There are seven different column types that can be used within a GridView. <asp:GridView ID="GridView1" runat="server"> <Columns> ... </Columns> </asp:GridView> BoundField: <asp:BoundField DataField="EmployeeID" Heade...

Page 277 of 1336