Jump to content

Error passing output to variable.


Recommended Posts

The following code executes correctly as written except for the last two parameters.

It does not generate an error in any form. It simply doesnt output to the variables or pass info to them. It does create an order as written and as far as I can tell is the correct structure.

Global $Dealer = "",  $OrderID = ""
$Tdesk.CreateFixOrder($Tdesk .FIX_OPENMARKET, "", 0, 0, "", "00123456", "EUR/USD", True, 10000, "Txt Here", $OrderID, $Dealer)
ConsoleWrite($OrderID & "   " & $Dealer & @CRLF )

Here is the proper setup.

CreateFixOrder (iFixOrderKind as Integer, sTradeID as String, dRate as Double, dRate1 as Double, sQuoteID as String, sAccountID as String, sInstrument as String, bBuySell as Boolean, iLots as Integer, sRemark as String, ByRef psOrderId as Variant, ByRef psDI as Variant)

I have been given the following additional info.

VB.NET does not require any specific keywords to pass the output variables. VB6 requires ByRef keywork, C# ref keyword, C++ - & operator and so on.

Once again - this does not depend on O2GO itself. O2GO just declares "by reference" parameter there. So it depends on the syntax of the programming language.

What Can I do to get this working? How to you catch a passed pram in autoit?

Link to comment
Share on other sites

$Tdesk.CreateFixOrder($Mdesk.FIX_OPENMARKET, "", 0, 0, "", "00123456", "EUR/USD", true, 10000, "Txt Here", ByRef $OrderID, ByRef $Dealer)

Does autoit support ByRef?

C:\Users\David\Desktop\Forex\Build Phase\CreateOrder.au3(117,108) : ERROR: syntax error

$Tdesk.CreateFixOrder($Mdesk.FIX_OPENMARKET, "", 0, 0, "", "00123456", "EUR/USD", true, 10000, "Txt Here", ByRef

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~^

C:\Users\David\Desktop\Forex\Build Phase\CreateOrder.au3 - 1 error(s), 0 warning(s)

Link to comment
Share on other sites

It does for function declarations... Not in com now that I think about it (last I heard anyway)

from help file-

Limitations on COM Events in AutoIt

Some Objects (like the 'WebBrowser') pass arguments to their Event Functions 'by reference'. This is intended to allow the user change these arguments and passing it back to the Object. However, AutoIt uses it's own variable scheme, which is not compatible to COM variables. This means that all values from Objects need to be converted into AutoIt variables, thus loosing the reference to the original memory space. Maybe in the near future we can solve this limitation for you !

edit- also: http://www.autoitscript.com/forum/index.php?showtopic=48136

Edited by evilertoaster
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...