vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Testing Zone (https://vborg.vbsupport.ru/forumdisplay.php?f=25)
-   -   C# code (https://vborg.vbsupport.ru/showthread.php?t=82068)

TosaInu 05-26-2005 03:08 PM

C# code
 
This is cut off at the first for loop on our board, wonder whether we have a 'conflicting' hack:

internal void MoveRow_FromTo(int iRowSrc, int iRowDst)

{

if (this.tabTally.SelectedTab == this.tabBHA)

{

int iSeqNoSrc = (int)this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"];

int iSeqNoDst = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst, "SeqNo"];



if (iRowSrc > iRowDst)

{

this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;

int iSeQNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst,"SeqNo"];

for (int i = iRowDst; i <= iRowSrc-1; i++)

{

iSeQNo = iSeQNo+1;

this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeQNo;

}



}

else if (iRowDst == this.m_usctblBHAActivityAssetList.grd.Rows.Count-1)

{

int iSeqNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"];

this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;



for (int i = iRowSrc+1; i <= this.m_usctblBHAActivityAssetList.grd.Rows.Count-1; i++)

{

this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

iSeqNo = iSeqNo+1;

}

}

else

{

int iSeqNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst+1, "SeqNo"];

this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst+1;



for (int i = iRowDst+1; i <= this.m_usctblBHAActivityAssetList.grd.Rows.Count-1; i++)

{

iSeqNo = iSeqNo+1;

this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

}

}

}

else if (this.tabTally.SelectedTab == this.tabDrillString)

{

int iSeqNoSrc = (int)this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"];

int iSeqNoDst = (int)this.m_usctblActivityAssetList.grd[iRowDst, "SeqNo"];



if (iRowSrc > iRowDst)

{

this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;

int iSeQNo = (int)this.m_usctblActivityAssetList.grd[iRowDst,"SeqNo"];

for (int i = iRowDst; i <= iRowSrc-1; i++)

{

iSeQNo = iSeQNo+1;

this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeQNo;

}



}

else if (iRowDst == this.m_usctblActivityAssetList.grd.Rows.Count -1)

{

int iSeqNo = (int)this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"];

this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;



for (int i = iRowSrc+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++)

{

this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

iSeqNo = iSeqNo+1;

}

}

else

{

int iSeqNo = (int)this.m_usctblActivityAssetList.grd[iRowDst+1, "SeqNo"];

this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst+1;

for (int i = iRowDst+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++)

{

iSeqNo = iSeqNo+1;

this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

}

}

}

}

Quote:

Originally Posted by TosaInu
This is cut off at the first for loop on our board, wonder whether we have a 'conflicting' hack:

internal void MoveRow_FromTo(int iRowSrc, int iRowDst)

{

if (this.tabTally.SelectedTab == this.tabBHA)

{

int iSeqNoSrc = (int)this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"];

int iSeqNoDst = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst, "SeqNo"];



if (iRowSrc > iRowDst)

{

this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;

int iSeQNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst,"SeqNo"];

for (int i = iRowDst; i <= iRowSrc-1; i++)

{

iSeQNo = iSeQNo+1;

this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeQNo;

}



}

else if (iRowDst == this.m_usctblBHAActivityAssetList.grd.Rows.Count-1)

{

int iSeqNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"];

this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;



for (int i = iRowSrc+1; i <= this.m_usctblBHAActivityAssetList.grd.Rows.Count-1; i++)

{

this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

iSeqNo = iSeqNo+1;

}

}

else

{

int iSeqNo = (int)this.m_usctblBHAActivityAssetList.grd[iRowDst+1, "SeqNo"];

this.m_usctblBHAActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst+1;



for (int i = iRowDst+1; i <= this.m_usctblBHAActivityAssetList.grd.Rows.Count-1; i++)

{

iSeqNo = iSeqNo+1;

this.m_usctblBHAActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

}

}

}

else if (this.tabTally.SelectedTab == this.tabDrillString)

{

int iSeqNoSrc = (int)this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"];

int iSeqNoDst = (int)this.m_usctblActivityAssetList.grd[iRowDst, "SeqNo"];



if (iRowSrc > iRowDst)

{

this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;

int iSeQNo = (int)this.m_usctblActivityAssetList.grd[iRowDst,"SeqNo"];

for (int i = iRowDst; i <= iRowSrc-1; i++)

{

iSeQNo = iSeQNo+1;

this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeQNo;

}



}

else if (iRowDst == this.m_usctblActivityAssetList.grd.Rows.Count -1)

{

int iSeqNo = (int)this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"];

this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst;



for (int i = iRowSrc+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++)

{

this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

iSeqNo = iSeqNo+1;

}

}

else

{

int iSeqNo = (int)this.m_usctblActivityAssetList.grd[iRowDst+1, "SeqNo"];

this.m_usctblActivityAssetList.grd[iRowSrc, "SeqNo"] = iSeqNoDst+1;

for (int i = iRowDst+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++)

{

iSeqNo = iSeqNo+1;

this.m_usctblActivityAssetList.grd[i,"SeqNo"] = iSeqNo;

}

}

}

}

<= is causing problems on our board.

Darax The Good 05-27-2005 02:47 PM

I find statements like:
for (int i = iRowSrc+1; i <= this.m_usctblActivityAssetList.grd.Rows.Count-1; i++)

To be very suspicious. Are you sure that you aren't off by one there? Could you just compare i < Rows.Count rather than i<=Rows.Count-1 ?

All those plus ones and minus ones are trouble.


All times are GMT. The time now is 06:59 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01049 seconds
  • Memory Usage 1,786KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete