# SAL Migration First Steps

## General Approach

Migrating your Gupta/Centura/OpenText application to a Wisej.NET web application can be achieved by utilizing our porting tool *Ice Porter* and our powerful support library [PPJ Framework](https://docs.iceteagroup.com/general/framework). The SQLWindows Application Language (SAL) is converted to C# or VB.NET, turning the existing legacy client/server application into a native browser-based solution.

File in the qrp format, that were developed using ReportBuilder, can be migrated and reused in widely used reporting frameworks such as SAP Crystal Reports, Microsoft's Reporting Services, combit List & Label, or Stimulsoft.

{% hint style="info" %}
Professional services and turn-key migration solutions are available from the makers of Wisej.NET and a number of international partners. [Get in touch!](https://wisej.com/modernization-request/)\
We have the knowledge, tools, and libraries to support you in the porting process.
{% endhint %}

### Porting SAL applications

#### Project Structure

All ported applications will be organized in a well defined [project structure](https://docs.iceteagroup.com/general/ported-application/project-structure).

#### Functions

[SAL and SQL functions](https://docs.iceteagroup.com/general/framework/features/sal-and-sql-functions) are fully supported, while some of them are renamed for consistency. Depending on the porting settings function calls can be transfored to a more **object oriented style**:

For example:

```csharp
SalStrLeftX(strName, 5, strName)
```

May have been ported to:

```csharp
strName = strName.Left(5);
```

All [Visual Toolchest](https://docs.iceteagroup.com/general/framework/features/visual-toolchest) and most of the [XSal2 ](https://docs.iceteagroup.com/general/framework/features/xsal2)functions are fully supported, too.

#### Data Types

All PPJ framework basic types support automatic casting to their equivalent .NET types allowing for a very smooth integration with .NET libraries.

For example:

```csharp
string name = strName;
```

Is the same as:

```csharp
string name = (string)strName;
string name = strName.ToString();
string name = strName.Value;
```

[Dynamic arrays](https://docs.iceteagroup.com/general/framework/data-types/dynamic-arrays) are kind of special in Gupta but are also fully supported.

#### SalContext for hWnd\* variables

hWndForm and hWndItem are widely used in SAL applications and are converted with using a [SalContext](https://docs.iceteagroup.com/general/framework/features/salcontext) construct to handle all the different usages.

SqlContext for Binding

Similar to the SalContext, the [SqlContext ](https://docs.iceteagroup.com/general/framework/sql-support/sqlcontext)is used to support bind variables at runtime.

#### LINQ Support

Once ported to the PPJ, Arrays and TableWindows can be queried easily using [LINQ](https://docs.iceteagroup.com/general/framework/features/linq-support).

#### SalCompileAndEvaluate

[SalCompileAndEvaluate ](https://docs.iceteagroup.com/general/framework/features/salcompileandevaluate)uses the interpreter to evaluate expressions. These are parsed in C# by default but [Custom Parsers](https://docs.iceteagroup.com/general/framework/extensions/custom-parsers) are also supported.

#### Special considerations

SAL applications usually contain a couple of "special" constructs that mostly stem from SAL being an interpreted language. Ice Porter and the PPJ framework offer great support in migrating these concepts to the .NET world.

You might want to pay special attention to these features and tasks. All of them are described in full details in our PPJ documentation.

* [Unqualified references](https://docs.iceteagroup.com/general/ported-application/project-structure/unqualified-references). Can be problematic in the original application already, need to be reviewed and fixed eventually.
* [When SQLError](https://docs.iceteagroup.com/general/ported-application/project-structure/when-sqlerror). Can be managed in 2 ways depending on your personal preferences.
* [Late Bind Calls](https://docs.iceteagroup.com/general/ported-application/project-structure/late-bind-calls). Are handled by additional virtual functions.
* [Multiple Inheritance](https://docs.iceteagroup.com/general/ported-application/multiple-inheritance). In general not available in .NET but isfully covered by IP and the PPJ framework.

### Porting QRP reports

Gupta reports can be [migrated ](https://docs.iceteagroup.com/general/ported-reports)to 4 different reporting engines:

* [Crystal Reports](https://docs.iceteagroup.com/general/ported-reports/crystal-reports)
* [List & Label](https://docs.iceteagroup.com/general/ported-reports/list-and-label)
* [Reporting Services](https://docs.iceteagroup.com/general/ported-reports/reporting-services)
* [Stimulsoft Reports](https://docs.iceteagroup.com/general/ported-reports/stimulsoft)
