?
Solved

i use the c++ builder and got some error!

Posted on 2000-03-27
5
Medium Priority
?
398 Views
Last Modified: 2012-05-04
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
  while(!Query1->Eof)
  {

      // get data from first table
      // and save data into csc
      String csc = Query1->FindField("STKCODE")->AsString;
     // String sss = csc;
     // Edit2->Text = csc;

      // into csc to second table and get data
      // String sss;
      Query2->Close();
      Query2->SQL->Clear();
      Query2->SQL->Add("select syear*100+smon,sb_vol,lb_vol,cp");
      Query2->SQL->Add("from ap.amgin");
      Query2->SQL->Add("where STKCODE = :sss");
      Query2->SQL->Add("and syear*100+smon >199702");
      Query2->Active=TRUE;
      Query2->ParamByName("sss")->AsString= csc;
      Query2->ExecSQL();
      Query2->Open();
      // use the data of second table to draw the line chart
      Series1->DataSource=Query2;
      Series1->ParentChart=DBChart1;
      XLabelsSource='syear*100+smon';
      YValues.ValueSource:= 'sb_vol';
      Series2->DataSource=Query2;
      Series2->ParentChart=DBChart1;
      XLabelsSource='syear*100+smon';
      YValues.ValueSource:= 'lb_vol';
      Series3->DataSource=Query2;
      Series3->ParentChart=DBChart1;
      XLabelsSource='syear*100+smon';
      YValues.ValueSource:= 'cp';
      DBChart1->SaveToBitmapFile("c:\\gmgin+csc+.bmp");
      Query1->Next();

  }


the code seems have some logic error.
but i couldn't debug.
i hope some one can help me.
thank you very much  
0
Comment
Question by:erichuang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 2660415
Why do you say it has an error?  what are the symptoms?
0
 

Author Comment

by:erichuang
ID: 2660667
the program has no error.
but i think maybe my logic is wrong
..so i need some body can suggest to me.
especially :
DBChart1->SaveToBitmapFile("c:\\gmgin+csc+.bmp");
the csc is a global value.
but i just can save to gmgin+csc+.bmp
not gmgin1101.bmp;gmgin1102.bmp.....
thank you very much!
0
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 600 total points
ID: 2661131
>>DBChart1->SaveToBitmapFile("c:\\gmgin+csc+.bmp");
Of course, it is error.
Right code:

char szName[255];
wsprintf(szName, "C:\\gmgin%d.bmp" ,csc);
DBChart1->SaveToBitmapFile(szName);
I hope, it helps. Alex
0
 

Author Comment

by:erichuang
ID: 2667532
i am glad to meet you!and thanks a lot
you give me much help.i hope next you can help me like this time!

                 eric
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2667814
Hi, eric. I am very glad to help you.
Don't forget evaluate my reply(accept
with some grade).
Alex
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question