Skip to content

MVsharp Developers Edition

How to install and use MVsharp Developers edition.

Contents

1 Introduction

2 Pre Requisites

3 Installing Sql Server Express

4 Install SQL Server Management Studio

4.1 Testing SQL Server Management Studio

5 Install MVsharp Developers Edition

5.1 Installing the MVsharp Service

5.2 Installing MVsharp Runtime

5.3 Install MVsharp Telnet Service

5.4 Install the MVsharp Terminal Emulator

5.5 Install MVsharp Change Over Administrator

5.6 Install Visual Studio Code

6 Validating the MVsharp Developer Edition Software

7 Creating new Accounts

8 Creating Files

8.1 Structure of a VOC File Pointer

8.2 Creating SQL Server Files and Directories

8.3 Q Pointers and Remote Files

9 Compiling basic programs

10 Configuring MVsharp Options

11 Executing windows commands

12 Accessing Printers

12.1 LISTPTR

12.2 SETPTR


Introduction

The MVsharp Developers Edition is a free single core, 10 users edition of the MVsharp suite of tools. It is targeted as SQL Server Express edition as the backend database. It is a full release version of the product and all its tools with the only limitation is that it will only use a single core on the machine that it is deployed onto and targets a SQL Server Express database.

It includes the following:

  1. MVsharp Service: This is the master service for MVsharp that manages users, locks and access.

  2. MVsharp Runtime: This is the runtime engine including support for BASIC, C#, Python, JavaScript and Typescript.

  3. MVsharp Telnet Service: Allows users to connect to MVsharp via telnet and SSH.

  4. MVsharp Terminal Emulator: A VT100 based terminal emulator.

  5. MVsharp Changeover Administrator: This allows you transfer applications and data from all MV databases including MVsharp, Universe, Unidata, D3, MvBase and jBASE. It also has tools to convert your SB+ applications to Netbuilder, Dynamically normalize you MV data in SQL Server and build Web Services.

  6. Visual Studio Code and Extensions: This is a modern IDE for writing code with MVsharp.


Prerequisites

The following environment is required in order to run the MVsharp Developers Edition.

  1. Windows 7 or above.

  2. .Net Framework 4.5.

  3. SQL Server Express.


Installing SQL Server Express

SQL Server Express is a free developers edition of SQL Server with some limitations. It is an ideal platform for MVsharp Developers Edition as there is no costs involved. We are using the latest version of SQL Server Express (2019) with MVsharp Developers Edition.

Download and run the SQL installer from the link:

SQL2019-SSEI-Expr

Run the installation media and the following screen is displayed:

devguide_pic_1

Select the "Basic" option and Accept the License Terms

devguide_pic_2

Select "Install" and SQL Server express will be downloaded and installed. When the installation is complete the following screens are displayed.

devguide_pic_3

Select "Close" button. You will need to restart the windows machine for the installation to complete.


Install SQL Server Management Studio

SQL Server Management Studio is a powerful tool that allows you to manage you sqk server environment. It is not required for MVsharp Developers Edition but can be very useful.If you do not require SQL Server Management studio you can continue onto Installing the MVsharp Server.

SSMS is installed by running SSMS-Setup-ENU.exe that can be found in the Developer Edition installation directory.

devguide_pic_4

Run the installation media and select Install.

The installation is done in a single step and once completed, the following screen is displayed.

devguide_pic_5

Configure SQL Server for MVsharp

You will need to set Mixed Mode Authentication and set the 'sa' password before we can install MVsharp.

devguide_pic_6

Your Machine Name and SQLEXPRESS should be defaulted in the Server name box.

  • Select Connect.

If you can successfully connect the following screen is displayed.

devguide_pic_7

Right click on the Database Instance and select "Properties". In the properties windows, select "Security"

devguide_pic_8

Ensure Sql Server and Windows Authentication mode is selected and press OK.

In the Object Explore pane, expand Security, Logins and right click on the sa user and select properties.

devguide_pic_9

Uncheck Enforce password policy and set the 'Password and Confirm Password options with a password you will use to connect to SQL Server. Remember this password as we will require it when installing MVsharp service and creating accounts.

Now select the Status page from menu.

devguide_pic_10

Ensure that Login is enabled and press OK.

Setup of SQL Server and SSMS is now complete.


Install MVsharp Developers Edition

In the installation media directory the following installers are located:

Installer Description
MVsharpService.msi The master service that controls users, locks, access to MVsharp.
MVsharp.msi The MVsharp Runtime.
MVsharpTelnet.msi The MVsharp Telnet Server.
MVsharpTerm.msi The MVsharp Terminal Emulator.
MVsharpChangeOver.msi The MVsharp Change over administrator.
VSCodeUserSetup-x64-1.26.1.exe A 64 bit version of Visual Studio Code.
VSCodeUserSetup-ia32-1.26.1.exe A 32 bit version of Visual Studio Code.

The above is also the order in which we install the software.

Installing the MVsharp Service

Run MVsharpService.msi as Administrator.

devguide_pic_11

Select Next and then Accept default folder by selecting Next on the following screen.

devguide_pic_12

Read the License Agreement and select Next to accept the terms of the License Agreement.

The MVsharp Default Account setup screen is displayed.

Modify the above screen with:

  • Set Sql Server to localhost\SQLEXPRESS

  • Set User Id to sa

  • Set Password to xxxxx <- the password specified when we configured SQL Express

  • Select Create

devguide_pic_13

The MVsharp Services is now installed.

Installing MVsharp Runtime

Run MVsharp.msi as Administrator.

devguide_pic_14

Select Next.

devguide_pic_15

You can select the defaults or specify your own install path and press Next.

devguide_pic_16

Accept the License Agreement and press Next.

devguide_pic_17

The MVsharp Runtime is now installed.

Install MVsharp Telnet Service

Run MVsharpTelnet.msi as Administrator.

devguide_pic_18

Select Next.

devguide_pic_19

Select the defaults or specify your installation directory and select Next.

devguide_pic_20

The MVsharp Telnet server is now installed.

Install the MVsharp Terminal Emulator

Run MVsharpTerm.msi as Administrator.

devguide_pic_21

Select Next.

devguide_pic_22

Select the defaults or specify your installation directory and select Next.

devguide_pic_23

Accept the License Agreement and press Next.

devguide_pic_24

The MVsharp Terminal Emulator is now installed.

Install MVsharp Change Over Administrator

Run MVsharpChangeOver.msi as Administrator

devguide_pic_25

Select Next.

devguide_pic_26

Select the defaults or specify your installation directory and select Next.

devguide_pic_27

Accept the License Agreement and select Next.

devguide_pic_28

The MVsharp Change Over administrator is now installed.

Install Visual Studio Code

Depending on your Window operating system, run either the 32 bit VSCodeUserSetup-ia32-1.62.2.exe or the 64 bit VSCodeUserSetup-x64-1.62.2.exe.

devguide_pic_29

Select Next.

devguide_pic_30

Accept the License Agreement and select Next.

devguide_pic_31

Accept the defaults or specify your folder and select Next.

devguide_pic_32

Select the options you would like to include in the install and select Next.

devguide_pic_33

All the software is now installed for the MVsharp Developers Edition.


Validating the MVsharp Developer Edition Software

We can now check that all the software is correctly installed and running. We first check the MVsharp Shell can connect to SQL Server and the MVsharp Service is running.

Locate the MVsharp Shell on the Windows Menu Under Prosol Group and run it.

devguide_pic_34

The first time the shell is run, it will created some default files and the above screen should appear. If no errors are reported, the Shell, Services and SQL Server are all configured and running correctly.

To test the Terminal Emulator and Telnet Services, locate the MVsharp Terminal Emulator on the Windows Menu Under Prosol Group and run it.

devguide_pic_35

Select the Open Connection button from the toolbar and the above screen will be displayed. Enter your Windows Credentials for the telnet server to authenticate yourself.

devguide_pic_36

If the above screen appears, the MVsharp Terminal emulator and the MVsharp Telnet server are working correctly.

For a full description of the functionality in Terminal Emulator, please refer to the "MVsharp Terminal Emulator" document.

MVsharp Terminal Emulator


Creating New Accounts

The concept of different accounts is supported by MVsharp. Each account is a self contained environment that has it's own VOC, File Pointers and programs.

Each MVsharp account consists of 2 parts:

  1. A database in SQL Server. Initially this will only contain the VOC, ERRMSG and DICT.DICT files and it's dictionary.

  2. A directory containing the Account.xml setup and all Directory files including system directory files like &HOLD&, &PH& and &SAVEDLISTS&

The CREATE.ACCOUNT command will create a new Account. The syntax is:

CREATE.ACCOUNT {AccountName}

In the example below we are going to create an Account called DEMO

>CREATE.ACCOUNT DEMO

Account Name :DEMO

Sql Server Instance :localhost

User Id :sa

Password :MVsharp

MVsharp Path (C:\MVsharp Accounts):

Updating Compiler Verbs

Updating Internal Verbs

Updating Database Verbs

Updating External Verbs

Updating Dictionary of VOC

Updating VOC

Executing Statements

Creating object directory 'MVsharp.BP.Lib'

Compiling ED

ED Compiled


Compiling INIT.MS.FILES

INIT.MS.FILES Compiled


ED Cataloged

INIT.MS.FILES Cataloged

Updating Compiler Verbs

Updating Internal Verbs

Updating Database Verbs

Updating External Verbs

Updating Dictionary of VOC

Updating VOC

Executing Statements

AE Cataloged

Initializing ERRMSG...

Creating Dictionary File D_ERRMSG

Creating File _ERRMSG

Updating DICT.DICT...

Creating File _DICT_DICT

Updating Sql Extensions

Updating Sql Extensions

Successfully deployed Sql Extensions on DEMO

Account "DEMO" Created

The new account is created and ready for use.


Creating Files

MVsharp supports a variety of file types and database storage engines all with the same account. The following is a list of supported files types and storage engines.

File Type Description
Hashed This is a hashed files similar to other MV systems hashed files. They do not support transaction processing and are created on the file system in the Accounts directory.
SqlArray Data is stored in SQL Server as a key value pair. The dynamic normalisation engine that MVsharp injects in SQL Server allows SQL to select and sort on these files. This is the preferred file type for SQL Server.
SqlServer Data is stored in SQL Server as a key xml pair. Your MVsharp application will however still receive a key record when accessing them from a MVsharp application.
SqlNative Data is stored in SQL Server as fully normalised SQL tables. The BASIC language has been enhanced to allow you to use the same BASIC syntax to select, read and write these normalised tables.
Directory Data is stored as files in a directory. (BP files are required to be in this format).
MongoDB Data is stored as a key list pair on a MongoDB Server. They behave exactly the same as SqlArray files except the stored engine is MongoDB. It also supports indexing.
Universe/Unidata Data is stored in a Universe/Unidata database but can be accessed as if they are local files to your MVsharp account.

The syntax for creating files is:

CREATE.FILE {FileName}

CREATE.FILE {FileName} Type={FileType}

CREATE.FILE {FileName} Type={FileType} ON {AccountName}

Structure of a VOC File Pointer

A VOC entry is created for each file in an Account. The structure of the VOC pointer is as follows:

>CT VOC CUSTOMER

CUSTOMER

0001 File

0002 _CUSTOMER

0003 D__CUSTOMER

0004 SqlServer

0005 {Account} <- only used for MongoDB, SqlNative, Universe, Unidata, QM and jBASE

Description:

  1. Must contain 'F' or 'File'

  2. The name of the Data Portion of the file

  3. The name of the Dictionary portion of the file

  4. The type of file

  5. The account name where the file resides


Creating SQL Server Files and Directories

To create the default SQLARRAY type SQL Server files you use:

CREATE.FILE CUSTOMER <- this will default to SQLARRAY

or

CREATE.FILE CUSTOMER Type=SqlArray

 

To create directory type files:

CREATE.FILE BP Type=Directory

This will create a directory in your current account as well as a Hashed file D_BP that will be used as the dictionary portion.


Q Pointers and Remote Files

MVsharp supports two different methods for accessing files in other accounts. The first method is to use standard Q pointers to create VOC entries that point to files in other accounts. Q pointers have always been dangerous as anyone with a little knowledge can access sensitive data by simply create a VOC entry to get financial or payroll data.

To overcome this security issue, MVsharp only allows access to data in other accounts if the account has been "Linked" to the source account. This is done in the administrator tool. Once the account has been linked, you can create normal Q pointers.

To see what accounts have been linked to your account, use the LINKED.ACCOUNTS function

Account Name        Account Type    Database Name Path

NetbuilderPlusLD    MVsharp        CRP c:\\MVsharp Accounts/NetbuilderPlusLD

ADSV16-EXEC         MVsharp        CRP C:\\MVsharp Accounts/ADSV16-EXEC

CRP                 MVsharp        CRP C:\\MVsharp Accounts/CRP

>

A Q Pointers is created like this:


>CT VOC PARAMS

PARAMS

0001 Q

0002 ADSV16-EXEC

0003 PARAMS

>

The second method is helpful when you wish to split the dictionary and data portions between 2 SQL Server databases. The format for Remote Pointers is:

>CT VOC CUSTOMER

   CUSTOMER

0001 F

0002 [CRP-DATA].[dbo].[_CUSTOMER]

0003 [CRP-DATA].[dbo].[D__CUSTOMER]

0004 SqlServer

The format is always:

[SQL Database].[dbo].[SQL FileName]

These are less secure as no account linking is required.


Compiling BASIC Programs

BASIC programs are transpiled into C# code and then compiled into a .Net dll. The dll's are stored in a Directory file with the same name as your program file with a .Lib suffix.

BASIC programs must be stored in a Directory file .

The syntax for compiling BASIC programs is:

BASIC {ProgramFile} {ProgramName} ({Options}

BASIC {ProgramFile} * ({Options}

BASIC {ProgramFile} ({Options <- Used when there is an active selectlist

 

Options Description
D Generate a dll that has debug and the symbol table. If this option is not specified, you will not be able to break into a program and all DEBUG statements are ignored.
G By default, the C# code is transient and is discarded once the dll has been generated. When the G option is specified, the C# code is written to a src directory in the .Lib folder.
L Used in conjunction with G option above. When the L option is specified, the C# source is written into the same file as the BASIC source code.
N Include lines numbers in the object.

Configuring MVsharp Options

MVsharp can emulate various 'Pick' flavours and these are configured in the MVSHARP.CONFIG record in the VOC file. Each configuration option is specified as a separate attribute.

The following options can be set:

Options Description
ENCODING={Encoding} This allows you to specify the encoding your wish strings to be encoded in your BASIC programs.
VSCODEDEBUG When specified, the debugger will attempt to connect to the Visual Studio Code MV# Debugger.
DATE.EUROPE When specified, the date is displayed in European Format: dd/MM/yyyy.
SHOW.TRACE When specified, the stack trace is displayed as programs are executed. This is useful for debugging batch processes but has no value in interactive processes.
INFORMATION.MODE When specified, the runtime environment emulates a PRIME INFORMATION mode.
PICK.MODE When specified, the runtime environment emulates a PICK mode.
COUNT.SUP When this option is specified all SELECT statement will be executed as asynchronous SQL queries. Records can be processed while the query is being executed. NOTE @SELECTED is not updated.
COLLATION={collation} Set the SQL Server Collation to be used when creating new files and when processing queries.
PICK.TCL Emulate the D3 TCL environment with a ':' prompt and '>' for active select list. D3 update processor commands also work on the TCL prompt.
UNIDATAEXEC The BASIC EXECUTE command behaves like Unidata including the ability to execute OS command with the "!" at the prompt.
D3.MODE The compiler emulates the D3 compiler, includes case insensitivity etc.
LOGTCL Every command executed from the command line is logged in the &LOGS& file.

Executing Windows Commands

Any Windows commands can be executed with 'DOS' command from the MVsharp command line. The DOS command creates a Windows command line shell, executes the arguments passed and returns to MVsharp command line.

This is useful when executing DOS functions to copy files, run DOS executables or get you environmental variables.

Example:


>DOS /c SET

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

PROCESSOR_ARCHITECTURE=x86

PROCESSOR_ARCHITEW6432=AMD64

PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel

PROCESSOR_LEVEL=6

PROCESSOR_REVISION=2c02

ProgramData=C:\ProgramData

ProgramFiles=C:\Program Files (x86)

ProgramFiles(x86)=C:\Program Files (x86)

ProgramW6432=C:\Program Files

PROMPT=$P$G

PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\

PUBLIC=C:\Users\Public

RemoteIpAddress=169.254.107.162

SystemDrive=C:

SystemRoot=C:\WINDOWS

TEMP=C:\WINDOWS\TEMP

TMP=C:\WINDOWS\TEMP

USERDOMAIN=ONGROUP

USERNAME=MVsharpSHARP-1$

 

Windows commands can also be executed from a BASIC program using the EXECTE function in BASIC.

Example:

Command = "copy c:\temp\file.txt e:\process.txt"

EXECUTE Command Capturing Output

CRT Output

Accessing Printers

MVsharp does not have it's own spooler. It utilizes the Windows Spooler, removing the complexity of managing 2 different spoolers. The following commands can be used to managing your print spooling.

All Windows Spooler functionality can be used with MVsharp including local printers, remote printers, UNC printers etc.

LISTPTR

The LISTPTR command will display a list of all the printers defined on your system.

>LISTPTR

Printer..............................Port.......................... Status..

microsoft xps document writer        PORTPROMPT:                    Running

microsoft print to pdf               PORTPROMPT:                    Running

fax                                  SHRFAX:                        Running

SETPTR

The SETPTR command either displays the current printers definitions or sets the printer definition you would like to use.


>SETPTR 1

Unit No : 1

Page Width : 132

Page Depth : 66

Top Margin : 3

Bottom Margin : 3

Print Mode : 1

Default Job Name : MVsharp

Destination Printer :

 

The format of the SETPTR is:

SETPTR unit {, width, depth, topmargin, bottommargin, mode, options}

 

Options Description
unit The printer unit from 0 to 10. Unit 0 is the default printer. Units 1 through 10 can be accessed by using the PRINT ON unit in BASIC.
width The page width.
depth The page depth.
topmargin No of lines to skip at the top of each page.
bottommargin No of lines to skip at the bottom of each page.
mode Defines where the output is directed.
1 -- output id to the printer device.
3 -- output is to a hold file.
options Additional options separated by comma's as defined below.
Additional Options Description
AT printername Direct output to specified printer.
AS filename Used with mode 3 to specify the name of the hold file.
AS NEXT id Used with mode 3 to specify an incremental starting number for subsequent hold file prints.
BRIEF Does not prompt you as to whether you wish to set the printer options.

Copyright © 2011 Prosol Group (Pty) Ltd

All rights reserved.

Prosol Group make no representations that the use of its products in the manner described in this publication will not infringe on existing or future patent rights, nor do the descriptions contained in this publication imply the granting of licenses to make, use, or sell equipment or software in accordance with the description.

Possession, use, or copying of the software described in this publication is authorized only pursuant to a valid written license from Prosol Group or an authorised sub licensor.

Neither Prosol Group nor its employees are responsible for any errors that may appear in this publication. The information in this publication is subject to change without notice.

All other trademarks and service marks are property of their respective holders.