Further Market
  • Essentials

    • Foreword
    • What is FM Script ?
    • The philosophy and benefits of FmScript
    • What you will learn
  • Recall

    • Internet: who? what? What is that?
    • Further market and FMScript
    • The compiler
  • Download
  • Getting started

    • Installation
    • Create a business account
    • Connect to the PC application
    • Create your first applet
    • Create your first web applet
    • Compiler view
  • Basics

    • basic rules
    • Reserved keywords
    • The Syntax
    • Coding Style
    • comments
    • Variables, constants, and data types
    • Convertion of types
    • Conditions and loops
  • Functions

    • Create a Menu
    • Create input field (Input2)
    • Create a QR Code
    • Scan a QR Code
    • Strings functions
    • Array functions
    • Date Time functions
    • Mathematics functions
    • JSON functions
    • XML functions
    • Call Http request
    • Manipulate Sessions
    • Financial functions
    • Notifications
    • Bleutooth Printer
  • Demos

    • Advanced Inputs
    • Call http Request
    • loops and conditions
    • Menu inputs
    • Array items count
    • Simpe for
    • simple select count Sql Query
    • Date and Time picker form
    • Get credit balance
    • is valid city
    • user info from phone number
    • get country and city from form
    • simple ussd link switch
    • charge user credit
    • simple message box
    • user entry code
    • get users relations
    • my external payements collected
    • call google Map
    • in App direct publish
    • Geo location
    • Charts
    • menu with hints
    • call system Messenger
    • user start code
    • In call Gallery
    • credit card payment Request
    • MTN CMR Airtime Product Subscription
    • MenuItemAddContacts
    • AJax and FM Input
    • Input2
    • MenuItemAddRichMedias
    • MenuItemAddTagsItems2
    • BlinBlin Menu + javascript
    • GENERAL ALERT MESSAGE WITH JSON OPTIONS
    • Barcode
  • databases

    • CRM
    • External Payments
    • Bills
    • Sales
    • Games
    • Applets
    • Payments Gateway
    • Manipulate Select Queries
  • APIs

    • Further Markey Pay button integration
    • Mobile Money cash collector
    • Bill Api
    • API PUBLISH PRODUCT
    • Sale Api
    • SMS Api
  • Advanced

    • Actions scheduler
    • Events settings
  • USSD CAMEROON

functions to manipulate Arrays

  • Create and Add Elements
    • ArrayItemAdd
    • ArrayInsertValue
  • ArrayGetValue
  • ArrayIndexOf
  • ArrayItemsCount
  • ArrayItemRemove
  • ArrayItemsClear
  • ArrayToStr
  • StrToArray
  • ArrayGetMinValue
  • ArrayGetMaxValue

In this section, we will describe some of functions used to manipulate Arrays on FMScript.

Create and Add Elements

FMscript propose two differents to initialise arrays: ArrayItemAdd and ArrayInsertValue

ArrayItemAdd

creates an array named 'ArrayName' (if it does not exist) and adds the elements as in a stack

Signature

            
ArrayItemAdd(ArrayName : String, ItemStr : String);  
            
        

Demo
            
var Result : String; 
                       
ArrayItemAdd('MyEngeneersArray', 'Richie');
ArrayItemAdd('MyEngeneersArray', 'Georges');         
Exit; 
            
        

Create an array named MyEngeneersArray with elements Richie and Georges

ArrayInsertValue

creates an array named 'ArrayName' (if it does not exist) and adds the elements to the specified index

Signature

            
ArrayInsertValue(ArrayName : String, APosition : Integer, PositionValue : String); 
            
        

Demo
            
var Result : String; 
                       
ArrayInsertValue('MyEngeneersArray', 0 , 'Richie');
ArrayInsertValue('MyEngeneersArray', 1 , 'Georges');         
Exit; 
            
        

the array index starts at zero

ArrayGetValue

Return string value at APosition in the array

Signature

            
ArrayGetValue(ArrayName : String, APosition : Integer);
            
        

Demo
            
var Result : String; 
                       
ArrayInsertValue('MyEngeneersArray', 0 , 'Richie');
ArrayInsertValue('MyEngeneersArray', 1 , 'Georges'); 

ShowMessage(ArrayGetValue('MyEngeneersArray', 0));        
Exit; 
            
        

The First element named Richie will be shown in the dialog Box.

ArrayIndexOf

Return the index if SearchStr found in array, if not found the return -1

Signature

            
ArrayIndexOf(ArrayName : String, SearchStr : String); 
            
        

Demo
            
var Result : String; 
                       
ArrayInsertValue('MyEngeneersArray', 0 , 'Richie');
ArrayInsertValue('MyEngeneersArray', 1 , 'Georges'); 

ShowMessage(ArrayIndexOf('MyEngeneersArray', 'Richie'));        
Exit; 
            
        

ArrayItemsCount

Return ItemsCount of ArrayName

Signature

            
ArrayItemsCount(ArrayName : String);  
            
        

Demo
            
VAR Result : String; 
VAR Count  : Integer;
                       
ArrayInsertValue('MyEngeneersArray', 0 , 'Richie');
ArrayInsertValue('MyEngeneersArray', 1 , 'Georges'); 

Count := ArrayItemsCount('MyEngeneersArray');
ShowMessage('Count = ' + IntToStr(Count));        
Exit; 
            
        

ArrayItemRemove

Return ItemsCount of ArrayName

Signature

            
ArrayItemRemove(ArrayName : String, Position : Integer);  
            
        

Demo
            
VAR Result : String; 
VAR Count  : Integer;
                       
ArrayInsertValue('MyEngeneersArray', 0 , 'Richie');
ArrayInsertValue('MyEngeneersArray', 1 , 'Georges'); 

Count := ArrayItemsCount('MyEngeneersArray');
ShowMessage('Count Before = ' + IntToStr(Count));  

//--remove
ArrayItemRemove('MyEngeneersArray',1);

Count := ArrayItemsCount('MyEngeneersArray');
ShowMessage('Count After = ' + IntToStr(Count));        
Exit;   
            
        

ArrayItemsClear

Clear Array Items and Return 1,XXX if success or 0,XXX if failed.

Signature

            
ArrayItemsClear(ArrayName : String);
            
        

Demo
            
VAR Result : String; 
VAR Count  : Integer;
                       
ArrayInsertValue('MyEngeneersArray', 0 , 'Richie');
ArrayInsertValue('MyEngeneersArray', 1 , 'Georges'); 

//--Clear
ArrayItemsClear('MyEngeneersArray');
       
Exit;   
            
        

ArrayToStr

Return concatenated ArrayName items with ADelimiter as a string.

Signature

            
ArrayToStr(ArrayName : String, ADelimiter : String);
            
        

Demo
            
VAR Result    : String; 
VAR ValueStr  : String; 
VAR Count     : Integer;
                       
ArrayInsertValue('MyEngeneersArray', 0 , 'Richie');
ArrayInsertValue('MyEngeneersArray', 1 , 'Georges'); 

//--Convert
ValueStr := ArrayToStr('MyEngeneersArray',';');

ShowMessage(ValueStr);       
Exit;   
            
        

StrToArray

Split a string to an array.

Signature

            
StrToArray(ArrayName : String, StringName : String, Delimiter : String); 
            
        

Demo
            
VAR Result    : String; 
VAR ValueStr  : String; 
VAR Count     : Integer;
                       
ValueStr := 'FM IS THE BEST'; 

//--Convert
StrToArray('MyEngeneersArray',ValueStr, ' ');

Count := ArrayItemsCount('MyEngeneersArray');
ShowMessage('Count = ' + IntToStr(Count));      
Exit;   
            
        

ArrayGetMinValue

Return min value in ArrayName if all values are numeric.

Signature

            
ArrayGetMinValue(ArrayName : String);   
            
        

ArrayGetMaxValue

Return max value in ArrayName if all values are numeric.

Signature

            
ArrayGetMaxValue(ArrayName : String);   
            
        

String functions
Date time functions


Our Partners

Support
      Telephone : (+237) 675979899 / 676009100
      Email : fm_support@f-m.fm
      P.O Box : 774 BAFOUSSAM
Available On

no
no

Further Market Inc
Copyright © 2012-2021.