MS4BIĀ®

MS4BI HELP 2022

by MS4script
01-Introduction
Preface & Copyright
Getting started
Informations + Cmd/param Server
Demos Simple
02- Declarations
Structure
Type
03- Instructions
Conditions if,do,while..
Char/Text functions Char or Text..()
Get + Include functions Get, Include..
String functions String# (hashtag)
Date-Time Day, Time, Year.
Display
Call
Formulas Complex
04- Database
Connector Ado, Odbc, Dsn, SAP, Ms4
DB Connect Create, delete
Import DataSource Import, Consolidation
Administration Admin, User
05- Sql-Query
Sql
Query Form : BTS,Plus
Grid option
06- Charts
Forms Plus, Win, Image, Excel, Morris...
Pie Std, Donut, 3D...
Bar Std, Stack, Line, Area, Plot
Radar
QrCode, Gauge
Step, Stock...
,Google,Leaflet... GeoMap
,Gantt,Timeline,Org.
DrawWindow [web]
07- Dashboard
Form tab, no tab
Responsive UI
08- Report
Report Hierarchy
Report Design
09- Filters
Dialogue + Call
10- Menus
Menu Design
Menu Frameset
Menu Custom
11-UI : Responsive
Tables Responsive,Frame,position
List Group
Text
Panel Header, body, Footer
Button Button, Progress Bar
Icon & Button
Collapse Group, Panel
Notifications
12- Encryption
Encrypt
Decrypt
13- Windows
Dialogue
Picture, Frame, Button..
MsgBox
Grid

Designer

00-OverView
01-Transaction
02-Setting
05-Import
10-Formula
15-Report-Part1
16-Report-Part2
20-Query-Part1
21-Query-Part2
25-Report-Query-Style
30-QrCodeImage
31-Windows
32-Frame
40-TabStrip
50-Collapse
60-BeginForm
63-Input-SubmitBox
70-Input-Select
71-Input-Insert
72-Input-Update
73-Input-Delete
75-Input-Query
77-ListComBo
81-Button-Link
82-Button-DataList
86-Sticky-Label
91-Insert-PhpJsHtml
92-Insert-MS4script
15- Css, html, Php, js.
Insert Native language Begin_sw..End_Sw
16-Install + tools.
Installation & Configuration This Menu
Generate Native... Php, Html, js..
Code Generator Ms4 Script
MarkDown Ms4 Script
Source Code Menu Help This Menu
written with ms4script
      

BASIC HELP : MS4BI by MS4script

2022 version 1.10

Chapter 3 : INSTRUCTION + FUNCTION

KEYWORD : IF THEN ELSE END_IF

Definition

if condition

Syntax

  	 	
	     if(expression)	
		  then
		      statement
			  else (optional)
			  statement
		 End_if	  
	

Example IF ..STRING

 
CHAR : word:20:= "@@@@@@@@"  ;
 
word := "ab";
word2 := "aa" ;

IF (word > word2) 
THEN 
	Display "  ok word > word2  : ", word Column 50,word2 Column 80;
ELSE
	Display "  not ok word < word2", word Column 50,word2 Column 60;
END_If ;
** output : "  not ok word < word2"	
	

Example IF ..function

 
INTEGER :   Y,Bc,Ca,A1 ;

Bc := 12; Ca := 500;
IF ((A1 := Bc * Ca) > 1000000) THEN 
	Display "1 A1 > 100 : ", A1 Column 50,Ca;
ELSE
	Display "2 A1 < 100 : ", A1 Column 50,Ca;
END_If;
** output : "2 A1 < 100 : "
	

Example IF ..Complex

 
 if (complex("(  ( (((2*30)+50 )^2)- ( (20-6 ) *2 ) ) "+
             " *1000000 /( (1000/2) *4 ) > 10   )" )  )   
then
   Display "true    " ; 
else
   Display "false   " ; 
end_if ;
** output : "false "
	

Return Values

    1 (TRUE) or 0 (FALSE).

Remarks

Operator name Syntax
comparison operator
Equal to a = b
Not equal to a != b
Greater than a > b
Less than a < b
Greater than or equal to a >= b
Less than or equal to a <= b
not void a not_void
void a void
Logical operators
Logical AND a and b
Logical OR a or b



KEYWORD : FOR

Definition

FOR loops are the most complex loops in MS4script.

Syntax

  The basic form of a FOR statement is:
for (expr1; expr2; expr3) Begin_for statement End_for ;

Example FOR

 
    For (I:=6; I < 10 ; I++)
	Begin_FOR
	Display " value  i ................", I ;
	End_FOR ;
** output : "  value  i .............. :6,7,8,9"	
	

Remarks

 
expr1 : The first expression, which initialises the variable 
expr2 : At the beginning of each iteration, expr2 is tested. If it evaluates to TRUE (1), the loop continues and the nested statement/s is/are executed. If it evaluates to FALSE(0), the execution of the loop ends.
expr3 : At the end of each iteration, expr3 is tested (run).



KEYWORD : WHILE

Definition

WHILE loops are the simplest type of loop

Syntax

  	 	
	     while (expr:condition)	
		 begin_while
		      statement
	 	 End_while	   ;	
	

Example WHILE

 
    integer : I:= 2; Y:= 2 ;
    While((I< 5) Or (Y < 5))
	Begin_WHILE
	 Display " WHILE 3 OR :value   i   ", I ;
	 Display " value of y   while  OR ",Y;
	
	 I++ ;
	 Y++;
	End_WHILE ;
 	

Remarks

    The meaning of a while statement is simple. It tells MS4script to execute  
	the nested statement(s) repeatedly, as long as the while expression evaluates to TRUE.  
	The value of the expression is checked each time at the beginning of the loop,  
	so even if the value changes during the execution of the nested statement(s),  
	execution will not stop until the end of the iteration (each time MS4script runs the statements 
	in the loop is one iteration). Sometimes, the while expression evaluates to FALSE 
	from the very beginning, in which case the nested statement(s) won't be run at all.
		



KEYWORD : DO..WHILE

Definition

do..while loops are executed at least once, and then again as many times as the test condition at the end remains true.

Syntax

  	 	
 begin_Dowhile
    statement
Dowhile (condition)	 ;			 
	

Example DO..WHILE

 
I:= 2 ; M1 := 1;
Begin_DOWHILE /* 1 dowhile */
I++ ;
 SetColorText(HWDISPLAY:green,blue); 
  Display "   i first dowhile ", I ;  
      Begin_DOWHILE /* 2 dowhile */
        Display "    m1 : second  dowhile ", M1;
        M1++ ;
     Dowhile (M1 < 5) ;

Dowhile (I < 5) ;
 	

Remarks

   
	The test that serves to quit is performed at the end of each iteration of the loop; 
	Consequently a do-while loop may run one or more times depending on the end expression value. 
  
The expression must be arithmetic.  
Execution proceeds as follows:

1) The body of the instruction is run.

2) Then, the expression is tested.  
If it is false, the do-while instruction ends and control is passed to the next instruction in the program.
. 
If the expression is true (different to zero), the process is repeated, beginning with step 1.	




KEYWORD : DO

Definition

do.. loops are simple loops which are performed a specified number of times

Syntax

  	 	
  Do(integer : number of iterations to be performed)
		statement
  end_do ;			 
	

Example DO..

 	
Incrdo1 := 0;
DO(3) /* perform 3 times */
 	incrDo1++ ;
	Display " incrDo1 : ",Incrdo1;
 	DO(4) /* 2nd nested DO */
 		incrDo2++ ;
		Display "   incrDo2  : ",Incrdo2;
	END_Do ;
	
END_Do ;
 	

Remarks

   
	 A DO loop is performed as many times as the integer value. 
  




KEYWORD : CASE_OF

Definition

case.. condition otherwise .. Tests an input value against specified possible vales.

Syntax

  	 	
  CASE_OF Namevar
	WHEN value1 : statement ;
	END_When;
	
	WHEN value2.. : statement ;
	END_When;
  
	Otherwise :
		statement ;
END_Case	;			 
	

Example case_of..

 
Text: word :="C";
CASE_OF Word
	WHEN "A" : Display "   it' s ok :  WHEN = A..... :  " ;
	END_When;
	
	WHEN "B" : Display "   WHEN = B ..... :  " ;
	END_When;
	
	WHEN "C" : Display "    WHEN = C ..... :  " ;
	END_When;
	
	Otherwise :
	Display "     OTHERWISE             " ;
END_Case	;

** output :     WHEN = C ..... :
 	

Remarks

   
	The case_of  statement is similar to a series of IF statements for the same expression.
It is ideal if you want to compare the same variable (or expression) with many different values,
and execute a different piece of code depending on which value it matches.



Interested in joining us? contact@mgplanete.com
The Mg Planete team


Copyright 2022 by Mandragore Planete

the official sites :
mgplanete.com
getms4bi.com
demos.ms4bi.com
help.ms4bi.com
ms4script.com

Download

official site :
getms4bi.com

Our purpose : Keep it simple !


written with ms4script
  • help 01.010.2022.8

MS4BI in 5 minutes