O$5: Calling an Omnis from another Omnis.

Omnis Central omniscentral at gmail.com
Fri Mar 6 03:47:18 EST 2015


 Hi,
I copy & paste this snippet below we are using for
calling a Omnis from another Omnis passing some
parameters.
This works with OmnisStudio 4.x but not with Omnis 5.x.
We get an error on TCPReceive:
in char Buffer we get this:

AOMNIS_ORFC   c503 Unable to locate specified Library or Class...

Any clues ?

THKS!

Gianni


Do method IP2Long (pcServerIP) Returns myServerIP
Calculate vStatic as 'OmnisLibrary=MYLBS'
Calculate vStatic as con(vStatic,'&OmnisClass=rtAlive')
TCPGetMyAddr  Returns lcMyIP

Calculate vStatic as con(vStatic,'&IPSender=',lcMyIP)
Calculate vStatic as con(vStatic,'&Msg=',pcMsg)

Calculate vStatic as con(vStatic,'&Name=',pcName)

Calculate TheLength as 23+len(vStatic)+len(CGIData)
Do method Num2Long (TheLength) Returns TheHeader
Calculate TheHeader as
con(TheHeader,'OMNIS_ORFC',chr(0,1,0,7),myServerIP,chr(0))

TCPConnect (pcServerIP, 5912) Returns TheSocket
TCPSend (TheSocket,TheHeader) Returns CharCount
TCPSend (TheSocket,vStatic) Returns CharCount
For count from 1 to len(CGIData) step cBlockSize
    Calculate Buffer as mid(CGIData,count,cBlockSize)
    TCPSend (TheSocket,Buffer) Returns CharCount
End For
Calculate Response as ''
Calculate Buffer as ''
Repeat
    Repeat
        TCPReceive (TheSocket,Buffer) Returns CharCount
    Until CharCount<>-10035     ;; If the port is not ready, try again
    If len(Response)<1     ;; the first 4 bytes will be the length of the
data coming back
        Do method Long2Num (Buffer) Returns DataLen
        Calculate DataLen as DataLen-18     ;; Remember to take off the
header length
        Calculate Response as mid(Buffer,19,len(Buffer)-18)     ;; and the
header
    Else
        Calculate Response as con(Response,Buffer)
    End If
    Calculate Buffer as ''
Until len(Response)>=DataLen
TCPClose (TheSocket) Returns CharCount
Calculate TheSocket as 0



More information about the omnisdev-en mailing list