pre.code { background-color: #E5E5E5; border: 1px solid #000000; width: 640px; padding: 5px; font-family: courier, verdana, arial, serif; margin: 0px 10px auto; }

Overview (FAQ4 ) -

Continuing


 

Manipulating edittables with large amounts of data is very resource intensive, this trick speeds it all up.
EQU DTM_RESETDATA$ TO 1025
handleWin = get_property(@WINDOW:".TABLE", "HANDLE")
call send_message(handleWin, DTM_RESETDATA$, 0, 0)

call set_property(@WINDOW:".TABLE", "LIST", listOfThings)

 

becuase the individual set_property ops into an edit table to an implicit get_property irrespective of if you want the original data or not.


OI & .xls

To see if a sheet is active, test for a property which will never be .null.
installed = (OLE.get_property(xlsheet,"name" NE "")

COMMON /xlwbCOMM/ installed%, xlapp%, xlsheet%

IF assigned(installed%) ELSE installed% = ::
IF installed% ELSE GOSUB create:


The issue of SQL install complaining of no access rights during the software install

1. msiexec /unreg & then msiexec /regserver


Check smtp support for TLS (http://www.checktls.com)
Scott's tools collection (http://hanselman.com/tools)
Power Tools for Windows (http://www.hanselman.com/blog/ScottHanselmans)

 

Section

Kaspersky : http://www.kaspersky.com/au/downloads/productupdates/endpoint-security-windows

Top of Page

Windows Tools


Download web page & file to disk

                  Declare Function GetWebPage<br>
                  retval =  getwebpage( url )<br>
                  SWAP CHAR(13) : char(10) With @FM IN retval<br>
                  SWAP CHAR(10) WITH @FM In retval<br>
                  SWAP @FM WITH CHAR(13) : CHAR(10) IN retval<br>
                  OSWrite retval To "c:\url.txt"<br><br>

ASAB

Downloading infoQ presentations

#! /bin/bash
                     
                     # Author: Shirish Padalkar (https://twitter.com/_Garbage_)
                     
                     if [ "$#" -ne 1 ]; then
 echo "Usage: $0 infoq_presentation_url"
 exit 1
 fi
 
 url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"`
 url=${url_with_spaces//<source src=/}
 
 echo "You can download this video from ${url// \/>/}"

Looks like it changes the User Agent id, so that infoQ streams the video - and hence it gets captured.
Another version:
curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10')" http://www.infoq.com/presentations/Scala-Guardian | grep "

DECLARE_FCNS

commandline = GetCommandLine() ; // get entire command line

GOSUB parse_commandline ; //

edit [SYSPROCS]/dll_kernel32 - add

 

KERNEL32
LPASTR STDCALL GetCommandLineA(VOID) as GetCommandLine

 

RUN DECLARE_FCNS 'DLL_KERNEL32'


Keep 2 edit tables in sync

In the VSCROLL event of TABLE_1 toppos = get_property(ctrledntid, "TOPPOS") result = set_property(@WINDOW:".TABLE_2","TOPPOS", toppos)

If you're using OLE and want to deal with large numbers, you could always set the column width

OlePutProperty(range,"ColumnWidth","18")

and set the formating

mFmt=_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)' ; pFmt=0.0%"

cRange=OleGetProperty(sheet,'Range',char(65+cnt):lRw-1:":":char(65+cnt):sRw )
iCells=cRange-]Cells
iCells-]NumberFormatLocal=pFmt


compile function z(void)

temp = ""

for i = 1 TO 3
   temp<1,12 + (3 * i) - 2>        = 12 + (3 * i) - 2
   temp<1,12 + (2 * i) + (i - 1)>  = 12 + (2 * i) + (i - 1)
   temp<1,12 + (2 * i) + i>        = 12 + (2 * i) + i
next i


rem **** begin ****
rem ** testoecgi3.bat - call oecgi3 without web server
rem ***

set COMSPEC=C:\Windows\system32\cmd.exe 
set DOCUMENT_ROOT=f:/apache/htdocs 
set HTTP_ACCEPT=*/* 
set HTTP_ACCEPT_ENCODING=gzip, deflate 
set HTTP_ACCEPT_LANGUAGE=en-us 
set HTTP_CONNECTION=Keep-Alive 
set HTTP_HOST=localhost
set HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; COM+ 1.0.2204) 
set PATH=c:\temp
set REMOTE_ADDR=127.0.0.1
set REMOTE_PORT=80
set SCRIPT_FILENAME=C:/Revsoft/OInsight/O4W/oecgi3.exe 
set SERVER_ADDR=127.0.0.1 
set SERVER_ADMIN=email@domain.com
set SERVER_NAME=localhost.domain.com 
set SERVER_PORT=80 
set SERVER_SIGNATURE=Local OECGI Test
set SERVER_SOFTWARE=NA
set SystemRoot=C:\Windows
set WINDIR=C:\Windows 
set GATEWAY_INTERFACE=CGI/1.1 
set SERVER_PROTOCOL=HTTP/1.1 
set REQUEST_METHOD=GET 
set QUERY_STRING= 
set REQUEST_URI=/o4w/oecgi3.exe/inet_trace
set SCRIPT_NAME=/o4w/oecgi3.exe


OECGI3.EXE ] test.txt
start test.txt

rem **** end ******

If you make a batch file in your OI subdirectory named test.bat as

rem **** begin ****
rem ** test.bat - call oecgi without web server
rem ***
set path_info=/inet_trace
set QUERY_STRING=test=1
OECGI.EXE ]test.txt
start test.txt

rem **** end ******
I use "Apache" web server. My httpd.conf file looks like this...

ScriptAlias /cgi-bin/ "C:/Program Files/Apache/htdocs/cgi-bin/"
ScriptAlias /OInsight/ "c:/program files/openinsight/"

My registry settings for "My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\RevSoft\OECGI" "WorkingDirectory"=c:\program files\openinsight"

Those files "OECGI.EXE" "RCL3.DLL" "REVCAP32.DLL" "UTF8.DLL" are in my "c:\program files\openinsight" directory, and nowhere else.

In OpenEngine there has always been a /I command line switch to have it run as a dedicated indexer. So if you had an application called MYAPP, you would run: OENGINE.EXE /I MYAPP


function Inet_Image(Request)
/*
*  return an image via OECGI
*/

declare function Inet_queryparam

$insert logical
$insert Inet_Equates

equ lf$ to \0A\

if assigned( Request ) else Request="

* Get the binary data from a file
path=bmps\sample.jpg"
osread binary_Data from path else binary_data='
content_length=len(binary_data)

image_type=jpeg'

result='
result := "Content-Type: image/": image_type : lf$
result := "Content-Length: ": content_length: lf$
result := lf$
result := binary_Data

* Flag response as Binary data
equ RESPONSE_IS_BINARY$ to 25
request<RESPONSE_IS_BINARY$>=true$

return result

regKey=HKEY_LOCAL_MACHINE\SOFTWARE\Revsoft\OECGI'
UserName = Registry_method('READO', RegKey:'\UserName')
DatabaseName = Registry_method('READO', RegKey:'\DatabaseName')
QueueName = Registry_method('READO', RegKey:'\QueueName')
ServerName = Registry_method('READO', RegKey:'\ServerName')
CreateFlags = Registry_method('READO', RegKey:'\CreateFlags')
ShutDownSessions=Registry_method('READO', RegKey:'\ShutDownSessions')
WorkingDir =Registry_method('READO', RegKey:'\WorkingDirectory')

function Inet_Test_Connect(Request)
*********************************************************************
*
* Product : OI
* Release : 8.1
*
* Name : Inet_Test_Connect
* Description: Generates the trace for HTTP request
*
* Parameters:
* Request in -- HTTP request 
* ret out -- HTML script with a trace 
*
* History (Date, Initials, Notes)
*********************************************************************

$insert inet_equates
declare function Serial, Registry_Method

html="

html ="
html ="
html = "
html = "
html = OpenInsight Inet_Test_Connect Response"
html = "
html = "
html ="
html = "
html = Congratulations!"
html = If you can read this, you have successfully connected to OpenInsight"
html = "
html ="

return html



rem From "Bob C" studios 
set path_info=/INET_YOURPROCNAMEHERE
set QUERY_STRING=your_arg1=someval&your_arg2=someval
oecgi.exe >test.txt
start test.txt


Is INET_XML in the CFG_OECGI whitelist?

OECGI checks a record in SYSENV named CFG_INET (OR CFG_INET*MYAPPLICATION) for a list of allowed routines (aka a whitelist) on line 5. Try adding INET_XML to that list and see if the example works.

Sample CFG_INET:
INET_SECURITYýINET_FINALIZEýINET_ABORTED
Cannot process query:û%query%

INET_XML


compile function inet_getOSFile(request,fileName) 
/*  ------------------------------------------------------------------------------------------------------------------------- 
    Author  : Rev Guy DownUnder - Original code from Bob Carten 
    Date    : 3 August 2007  
    Purpose : Reads a file from disk, then builds the HTTP header 
              and returns the file as raw data to be displayed on 
              the web. Sets the RESPONSE_IS_BINARY flag so that 
              OECGI(2) does not mess with the raw data. 
 
    Modification Info:  
    ------------------------------------------------------------------------------------------------------------------------- 
    Date        Who     Notes 
    ------------------------------------------------------------------------------------------------------------------------- 
     
    Parameters: 
    ------------------------------------------------------------------------------------------------------------------------- 
    request     - the request string as passed from OECGI 
                 
                filename=the full path to the file to return 
                 
    filename    - (optional) the full path and filename to the file 
 
    Returns: 
    ------------------------------------------------------------------------------------------------------------------------- 
    result      - a string starting with the HTTP content header followed 
                  by the raw file data. 
                   
    -------------------------------------------------------------------------------------------------------------------------*/ 
     
declare function inet_queryParam, inet_msg, unAssigned 
     
$insert logical 
$insert inet_equates 
equ null$   to "" 
equ lf$     to \0A\ 
 
if unAssigned(request) then request=null$ 
if unAssigned(fileName) then fileName=null$ 
 
// if fileName is null then extract if from the request string 
if fileName="" then 
    fileName=inet_queryParam(request,"filename") 
end 
 
imageFormats="jpg,tif,bmp,gig,png" 
convert "," to @fm in imageFormats 
 
appFormats="zip,smf,pdf" 
convert "," to @fm in appFormats 
 
result=""  
 
if fileName then 
    // determine the fileType from the file extension 
    fileType=fileName-1,"B." 
    convert @upper.case to @lower.case in fileType 
     
    // select the correct HTTP content type 
    contentType="text" 
    locate fileType in imageFormats using @fm setting pos then 
        contentType="image" 
    end 
     
    locate filetype in appFormats using @fm setting pos then 
        contentType="application" 
    end  
     
    osread fileData from fileName then 
        // build the content header then attach the raw file data 
        result="Content-Type: ":contentType:"/":fileType:" ":lf$ 
        result := "Content-Length: ":len(fileData):" ":lf$ 
        // the next line sets the filename of the file so the 
        // user can save it as the original filename. 
        result := "Content-Disposition: attachment; filename=:quote(fileName[-1,"B\"]):" ":lf$ 
        result := lf$ 
        result := fileData 
         
        // ensures that the returned raw data is not messed up by OECGI(2) 
        request=true$ 
    end else 
        result=inet_msg(request,"Failed reading file ":fileName) 
    end 
end else 
    result=inet_msg(request,"No filename passed to INET_GETFILE") 
end 
 
return result 
end 

This is the code that builds the result variable. Is this exactly how it should be formatted and returned?

    osread fileData from fileName then 
        // build the content header then attach the raw file data  
        result="Content-Type: ":contentType:"/":fileType:" ":lf$  
        result := "Content-Length: ":len(fileData):" ":lf$  
        // the next line sets the filename of the file so the  
        // user can save it as the original filename.  
        result := "Content-Disposition: attachment; filename=:quote(fileName[-1,"B\"]):" ":lf$  
        result := lf$  
        result := fileData  
         
        // ensures that the returned raw data is not messed up by OECGI(2)  
        request=true$ 
    end else  
        result=inet_msg(request,"Failed reading file ":fileName)  
    end  
end else  
    result=inet_msg(request,"No filename passed to INET_GETOSFILE")  
end


/*

OeSocketClient.cs


An example of calling Executing an OpenInsight function using the OeSocketServer



*/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net.Sockets;
using System.Collections;
using System.Threading;

namespace Example_Console
{
    class OeSocketClient
    {
        // Constants	
        private const int portNum = 8088;
        private char DELIM = Convert.ToChar(1);
        private const string CLOGIN = "1";
        private const string CLOGOFF = "2";
        private const string CCALL = "3";
        private const string CQuery = "-1";
        private const string CResetGentle = "-2";
        private const string CResetForce = "-3";
        private const int PREFIXLEN = 8;
        private const string PREFIXFMT = "00000000";
                  	
        private const string hostname_default = "localhost";
        private const int port_default = 8088;
        private const string servername_default = "";
        private const string database_default = "EXAMPLES";
        private const string username_default = "EXAMPLES";
        private const string password_default = "";
        private const string procedurename_default = "RUN_OECGI_REQUEST";

        private TcpClient tcpClient;
        private NetworkStream networkStream;

        // Fields    	
        private bool connected = false;            	
        private string hostname = "";
        private int port = 0;
        private string servername = "";
        private string database = "";
        private string username = "";
        private string password = "";
        private string procedurename = "";
        private string response = "";
        private string m_configfile = "";


        // Properties
        public string ConfigFile
        {
            get { return m_configfile; }
            set { m_configfile = value; }
        }
        public string Response
        {
            get
            {
                return this.response;
            }
        }

        public string Hostname
        {
            get
            {
                return hostname;
            }
            set
            {
                hostname = value;
                if (value.Equals("")) hostname = hostname_default;
            }
        }

        public int Port
        {
            get
            {
                return port;
            }
            set
            {
                port = value;
                if (value == 0) port = port_default;
            }
        }
        public string Servername
        {
            get
            {
                return servername;
            }
            set
            {
                servername = value;
                if (value.Equals("")) servername = servername_default;
            }
        }

        public string Database
        {
            get
            {
                return database;
            }
            set
            {
                database = value;
                if (value.Equals("")) database = database_default;
            }
        }
        public string Username
        {
            get
            {
                return username;
            }
            set
            {
                username = value;
                if (value.Equals("")) username = username_default;
            }
        }
        public string Password
        {
            get
            {
                if (password.Equals("")) password = password_default;
                return password;
            }
            set
            {
                password = value;
                if (value.Equals("")) password = password_default;
            }
        }
        public string Procedurename
        {
            get
            {
                return procedurename;
            }
            set
            {
                procedurename = value;
                if (value.Equals("")) procedurename = procedurename_default;
            }
        }

    	
        public int loadProfile()
        {
        	
            this.Hostname = "localhost";        	
            this.Port = 8088;

            this.Database = "MYAPP";
            this.Username = "MYUSER";
            this.Password = "MYPASS";
        	
            this.Procedurename = "MY_LISTENER";

            return 0;
        }

        public int resetProfile()
        {
            // restore to default settings
            hostname = hostname_default;
            port = port_default;
            servername = servername_default;
            database = database_default;
            username = username_default;
            password = password_default;
            procedurename = procedurename_default;
            return 0;

        }

        private bool connect()
        {
            if (connected)
            {
                disconnect();
            }

            loadProfile();
            tcpClient = new TcpClient();
            try
            {
                tcpClient.Connect(hostname, port);
                networkStream = tcpClient.GetStream();
                if (networkStream.CanWrite && networkStream.CanRead)
                {
                    connected = true;
                }
                else if (!networkStream.CanRead)
                {
                    Console.WriteLine("You can not write data to this stream");
                    tcpClient.Close();
                }
                else if (!networkStream.CanWrite)
                {
                    Console.WriteLine("You can not read data from this stream");
                    tcpClient.Close();
                }
            }
            catch (SocketException e)
            {            	
                Console.WriteLine("Server not available! - {0}",e.Message);
                disconnect();
            }
            catch (System.IO.IOException)
            {
                Console.WriteLine("Sever not available!");
                disconnect();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                disconnect();
            }

            return connected;
        }

        public void disconnect()
        {
            try
            {
                tcpClient.Client.Close();
                networkStream.Close();
                tcpClient.Close();
            }
            catch { }

        }



        // All Messages encoded 8 byte length prefix, string
        public bool sendMessage(string messageIn, ref string messageOut)
        {

            bool success = false;

            int bytesRead = 0;

            string prefix = messageIn.Length.ToString(PREFIXFMT);
            string datatosend = prefix + messageIn;

            // Clear response property
            messageOut = "";

            if (!connected) connect();

            try
            {
                Byte[] sendBytes = Encoding.ASCII.GetBytes(datatosend);
                networkStream.Write(sendBytes, 0, sendBytes.Length);

                // Read 8 bits to get expected size of response
                byte[] prefixbytes = new byte[PREFIXLEN];
                bytesRead = networkStream.Read(prefixbytes, 0, PREFIXLEN);

                string prefixdata = Encoding.ASCII.GetString(prefixbytes, 0, bytesRead);
                int responsesize = 0;
                if (!prefixdata.Equals(""))
                {
                    responsesize = Convert.ToInt32(prefixdata);
                }

                int bufferSize = Math.Min(responsesize, tcpClient.ReceiveBufferSize);

                byte[] bytes = new byte[bufferSize];

                int receivedSize = 0;
                StringBuilder responseMessage = new StringBuilder();

                // Pull back message in Chunks
                while (receivedSize < responsesize)
                {
                    bytesRead = networkStream.Read(bytes, 0, bufferSize);
                    receivedSize += bytesRead;
                    string charsRead = Encoding.UTF8.GetString(bytes, 0, bytesRead);
                    responseMessage.Append(charsRead);
                }

                // Parse the data received from the host
                // Sucess looks like
                // 1 byte code (1) , message, trailing delim
            	
                string responseCode = responseMessage.ToString(0, 1);
                success = (responseCode == "0");
                if (success)
                {
                    messageOut = responseMessage.ToString(2, responsesize - 3);
                }
                else
                {
                    messageOut = "bad response";
                }

            }
            catch (Exception e)
            {
                messageOut = "OpenInsight Communication Error " +  e.ToString();
                success = false;
            }

            return success;
        } // end sendMessage

        public bool logon()
        {

            // Logon, set dispatch routine
            string message = CLOGIN + DELIM
                + username + DELIM
                + Password + DELIM
                + database + DELIM
                + "2" + DELIM
                + servername + DELIM
                + procedurename + DELIM;

            string result = "";
            bool success = sendMessage(message, ref result);
            return success;

        }

        public bool logoff()
        {
            string message = CLOGOFF + DELIM;
            string result = "";
            bool success = sendMessage(message, ref result);
            return success;
        }
  	

        public bool runRequest(string OiMethod, string request)
        {
            string encoded = base64Encode(request);
            response = "";
            bool isOk = true;

            if (isOk = connect())
                isOk = logon();

            if (isOk)
            {
                string message = CCALL + DELIM + OiMethod + DELIM + encoded + DELIM;
                string result = "";
                isOk = sendMessage(message, ref result);
                if (isOk)
                {
                    response = base64Decode(result);
                }
            }


            logoff();
            disconnect();
            return isOk;
        }

        public string base64Encode(string data)
        {
            try
            {
                byte[] encData_byte = new byte[data.Length];
                encData_byte = System.Text.Encoding.UTF8.GetBytes(data);
                string encodedData = Convert.ToBase64String(encData_byte);
                return encodedData;
            }
            catch (Exception e)
            {
                throw new Exception("Error in base64Encode" + e.Message);
            }
        }

        public string base64Decode(string data)
        {
            try
            {
                System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
                System.Text.Decoder utf8Decode = encoder.GetDecoder();

                byte[] todecode_byte = Convert.FromBase64String(data);
                int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
                char[] decoded_char = new char[charCount];
                utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
                string result = new String(decoded_char);
                return result;
            }
            catch (Exception e)
            {
                throw new Exception("Error in base64Decode" + e.Message);
            }
        }
    }

}


Basic+ SocketServerClient

Function OESocketServer_Example(connection, method,Param1,Param2,Param3,Param4,Param5,Param6)
/*
**  Remote Engine Example using Socket Server
* Note OeSocketServer's protocol is similiar To JD3, an Open Source project for communicating with D3
* See JD3 protocol at http://sourceforge.net/docman/display_doc.php?docid=2430&group_id=16418
*/

declare function socket_functions
Declare Subroutine Set_Status

$Insert Msg_Equates
$Insert Logical

Equ delim$ To \01\
Equ cLOGIN$        To "1"
Equ cLOGOFF$       To "2"
Equ cCALL$         To "3"
Equ cQuery$        To "-1"
Equ cResetGentle$  To "-2"
Equ cResetForce$   To "-3"
Equ valid_codes$ To "1 2 3 -1 -2 -3"


*------
* Main
*------

If Assigned(connection) Else connection = ''
If Assigned(method) Else method = ''
p1 = If Assigned(param1) Then param1 Else ''
p2 = If Assigned(param2) Then param2 Else ''
p3 = If Assigned(param3) Then param3 Else ''
p4 = If Assigned(param4) Then param4 Else ''
p5 = If Assigned(param5) Then param5 Else ''
p6 = If Assigned(param6) Then param6 Else ''
err = ''
retval = ''

Begin Case
	Case method = 'CONNECT'           ; Gosub Connect
	Case method = 'DISCONNECT'        ; Gosub DisConnect
	Case method = 'CALLSUBROUTINE'    ; Gosub CallSubroutine
	Case method = 'SENDMESSAGE'       ; Gosub SendMessage
	Case method = 'GET_ROW'           ; Gosub GetRow
	Case method = 'WRITE_ROW'         ; Gosub WriteRow
	Case method = 'SELECT'            ; Gosub DoSelect
	Case method = 'TEST'              ; Gosub Test
End Case


Return retval
*****

test:

isOk = true$

* Open A socket connection to Socketserver
* similar to CreateEngine
url = 'localhost:8088'
Gosub Connect
isOk = ( connection > 0 )

* Login
* Similar To CreateQueue
* A key difference is that you register a dispatch routine
* The socket server will pass parameters to the dispatch routine
* Whenever you send a command, the socket server will Call the dispatch routine
* In this example, I use RUN_OECGI_REQUEST as the dispatch routine

if isOk then
	UserName = 'SYSPROG'
	Database = 'SYSPROG'
	Password = ''
	ServerName = ''
	DispatchFuncName = ''
	Gosub Login
end

*
* Run a command
* In this example, because RUN_OECGI_REQUEST is the dispatch routine, I build what looks like an INET request
*

$Insert INET_EQUATES

* Make 100 calls across the connection to test for speed
For i = 1 To 100
	
    * My Inet request
    request  = "i=" : i :"&time=" : time()
    request = "/INET_TRACE"
   
    * Package the request in JD3 protocol
    sMsg  = cCall$
    sMsg := delim$:request
    sMsg := delim$
   
    * Send it
    Gosub SendMessage
   
    * Echo the first line
    retval = results[1,\0D\]
    call send_dyn(retval)
next

Gosub DisConnect


Return
******


* TBD
GetRow:
WriteRow:
DoSelect:

Return

Connect:
If Assigned(url) Else
    url = P1
End

connection = ''
ret = Socket_functions(connection,'CONNECT',url)

Return

DisConnect:

* Send Logout Command


sResult = ''
sMsg = cLOGOFF$: DELIM$
Gosub SendMessage
bIsConnected = False$

* Close Socket
ret = Socket_functions(connection,'DISCONNECT')

Return

Login:

sMsg = ""
sResult = ""
sMsg = cLOGIN$
sMsg := DELIM$ : UserName
sMsg := DELIM$ : Password
sMsg := DELIM$ : Database
sMsg := DELIM$ : "2"
sMsg := DELIM$ : ServerName
sMsg := DELIM$ : OiFuncName
sMsg := DELIM$

Gosub SendMessage
bIsConnected = ( sResult[1, 1] = "0" )

Return

CallSubroutine:
SubName = P1
SubParams = P2

Convert @rm To delim$ In subparams
sMsg = cCall$
sMsg := delim$: SubName:delim$:SubParams
sMsg := delim$

Gosub SendMessage


Return



SendMessage:

* Steps:
If Assigned(sMsg) Else sMsg = P1
numOutgoing = Len(sMsg)
If Len(numOutgoing) > 8 Then
    err = "String Overflow"
    Set_Status(-1,err)
    Return
End
sRealMsg = fmt(numOutgoing, "R(0)#8"):sMsg


* 4. send byte buffer
ret = socket_functions( connection, 'DOWRITE', sRealMsg )

* now get the response...

* 1. Wait for the 8 character packet size;
Results = ''
resultlen = ''
ret = socket_functions(connection, 'DOREAD', 8, resultLen)
If resultlen Then
    ret = socket_functions(connection, 'DOREAD', resultLen, Results)
End

* trim off leading code,delim, And trailing delimiter
Results[1,2] = ''
Results[-1,1] = ''


return


Link to .php code


content=Get_Property(@window:'.OLECONTROL_1', 'Document.Body.InnerHtml')


INET_Aborted (in OI 7.0) receives the subroutine and line number of any abnormal end to a program (VNAV, etc.) as a second parameter, I thought it would be great to instantly text message my cell phone with the error. This allows me to continue developing parts of the website while leaving the rest of it fully functional. I have a simple routine that successfully sends out messages (using MAPISendMail). However, it only works when OECGI is in "Named Server" mode. When I change the registry entries to "Dynamic Instance" mode, MAPISendMail fails.


  

Setting cell colours and using colours_html to get more variety

 c = 'FFFF00'
d = ICONV(c,"MX") ; // correct format for setting color in OI


This is the proper way to code date output, vs inline OCONV("D2/E")

TimeText = 	OCONV(FIELD(Rkey,'*',4),'[IOTIME]')
						TimeText := '-':OCONV(FIELD(Rkey,'*',5),'[IOTIME]')