VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12345678[9]10 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 10:52:13 07/30/00 Sun
Author: jack
Subject: very simple question

Hi :
i am a new programmer for BCB. now, i am built a very simply program,but the function
"storeangleinfo" doesn't work.The value always are zero.why?
void __fastcall TForm1::FormPaint(TObject *Sender)
{
int zerox=Width/2,zeroy=Height/2,len=0,counter=0;
int m=8,m1=0,subx=0,suby=0,m2=0,m3=1,m4=1;
Con[0][0]=0;
Cx[0][0]=zerox;
Cy[0][0]=zeroy;
...
for (int k=1;k<i;k++)
{
m3=m3*2;
}
m=m3*m;
subx=Cx[i-1][0];
suby=Cy[i-1][0];
m1=0;
for (int j=0;j<(m-1);j++)
{
Canvas->MoveTo(Cx[i][j],Cy[i][j]);
Canvas->LineTo(Cx[i][j+1],Cy[i][j+1]);
if (i==1)
{
storetriangleinfo(Cx[i][j],Cy[i][j],Cx[i][j+1],Cy[i][j+1],
Cx[0][0],Cy[0][0],counter);

Canvas->MoveTo(Cx[i][j],Cy[i][j]); //draw line
Canvas->LineTo(Cx[0][0],Cy[0][0]);
counter++;
}
else
{
...
}

//---------------------------------------------------------------------------
void _fastcall TForm1::storetriangleinfo(int x1,int y1,int x2,int y2,int x3,int y3,int counter)
{

triangleinfo[counter][0]=x1;
triangleinfo[counter][1]=y1;
triangleinfo[counter][2]=x2;
triangleinfo[counter][3]=y2;
triangleinfo[counter][4]=x3;
triangleinfo[counter][5]=y3;

}
//------------------------------------------------------
The header is:
class TForm1 : public TForm
{
__published: // IDE-managed Components
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormPaint(TObject *Sender);
private: // User declarations

public: // User declarations

int zerox,zeroy,len,counter;
int m,m1,subx,suby,m2,m3,m4;
int Cx[10][100],Cy[10][100],Con[10][100],triangleinfo[2000][6];
__fastcall TForm1(TComponent* Owner);
void _fastcall storetriangleinfo(int x1,int y1,int x2,int y2,int x3,int y3,int num);
};

Thanks in advance
Jack

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.