Sign in to follow this  
Followers 0
John117

Help translating something writen in CS to autoit

3 posts in this topic

#1 ·  Posted (edited)

Hey I am writing an app and need help with this section.

Please help if you can.

CODE

;find the offer table and fill the list view with all instruments.

mOffers = (TableAut)mDesk.FindMainTable("offers");

for (uint i = 1; i <= mOffers.RowCount; i++)

string s = mOffers.CellValue(i, "Instrument").ToString();

ListViewItem lvi = listViewInstruments.Items.Add(s);

mItems = lvi;

lvi.SubItems.Add(mOffers.CellValue(i, "Bid").ToString());

lvi.SubItems.Add(mOffers.CellValue(i, "Ask").ToString());

Edited by Hatcheda

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hey I am writing an app and need help with this section.

Please help if you can.

;find the offer table and fill the list view with all instruments.
            mOffers = (FXCore.TableAut)mDesk.FindMainTable("offers");
            for (uint i = 1; i <= mOffers.RowCount; i++)

                string s = mOffers.CellValue(i, "Instrument").ToString();
                ListViewItem lvi = listViewInstruments.Items.Add(s);
                mItems[s] = lvi;
                lvi.SubItems.Add(mOffers.CellValue(i, "Bid").ToString());
                lvi.SubItems.Add(mOffers.CellValue(i, "Ask").ToString());

What I have so far: - not much but gets feeds array info once array created.

;find the offer table and fill the list view with all instruments.
$Offers = $tdesk.FindMainTable("offers");
Maybe something like this:
Global $tdesk = ???
Global $hLV = _GUICtrlListView_Create(...)

;find the offer table and fill the list view with all instruments.
$mOffers = $tdesk.FindMainTable("offers")

For $i = 1 To $mOffers.RowCount
    $sString = $mOffers.CellValue($i, "Instrument").ToString()
    $iLVItem = _GUICtrlListView_AddItem($hLV, $sString)
    _GUICtrlListView_AddSubItem($hLV, $iLVItem, $mOffers.CellValue($i, "Bid").ToString(), 1)
    _GUICtrlListView_AddSubItem($hLV, $iLVItem, $mOffers.CellValue($i, "Ask").ToString(), 2)
Next

A lot of guessing here. You must have already created the $tdesk object and the ListView control whose handle is in $hLV.

:P

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

$Offers.RowCount ??? and $Offers.RowCount - 1 ???

Worked perfecty! Thanks for the "For $i = 1 To $mOffers.RowCount" Section!

Share this post


Link to post
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
Sign in to follow this  
Followers 0