Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2000-03-27
5
Medium Priority
?
399 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

618 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