Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c++ builder newbie

Status
Not open for further replies.

GiSH

Technical User
Oct 31, 2001
7
JP
GiSH

well....erm...help?

I've had some experience with c++ (mainly usin code warrior at uni) but now I'm tryin to use builder to alter a program written in builder.
The program takes information from an IR sensor on COM1 and refer's it to a small display program which lights up little shapes if a button is pressed on an IR remote.
The only problem
I'm totally lost in the code
I've roughly got how it works, mainly the bit that lights up the shapes.
I wanted to uase this program as a kind of from end for a very basic game i.e. snake or even just a movin shape that can be controlled around the screen by the IR remote
The only problem....
how???
 
Get specific about which part of the code you don't understand, then post the piece of code (the smaller the better) here and we'll see if we can help you.
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
void __fastcall TFormMain::locDispHex()
{
// String stTemp;
char szStringBuff[256];
switch(ddd[0]){
case 20:{
wsprintf(szStringBuff,"%6d %02X %02X %02X %02X %02X "
,dwFrame,ddd[0],ddd[1],ddd[2],ddd[3],ddd[4]);
switch(ddd[1] & 0x03){
case 0:{ // ID 1
if((ddd[2] & 0x10)==0){
PaintForm->Shape1_34->Brush->Color=clBlue; }
else{
PaintForm->Shape1_34->Brush->Color=clRed; }
if((ddd[2] & 0x20)==0){
PaintForm->Shape1_35->Brush->Color=clBlue; }
else{
PaintForm->Shape1_35->Brush->Color=clRed; }
if((ddd[2] & 0x08)==0){
PaintForm->Shape1_33->Brush->Color=clBlue; }
else{
PaintForm->Shape1_33->Brush->Color=clRed; }
if((ddd[2] & 0x04)==0){
PaintForm->Shape1_32->Brush->Color=clBlue; }
else{
PaintForm->Shape1_32->Brush->Color=clRed; }
if((ddd[2] & 0x40)==0){
PaintForm->Shape1_36->Brush->Color=clBlue; }
else{
PaintForm->Shape1_36->Brush->Color=clRed; }
if((ddd[2] & 0x80)==0){
PaintForm->Shape1_37->Brush->Color=clBlue; }
else{
PaintForm->Shape1_37->Brush->Color=clRed; }
if((ddd[3] & 0x01)==0){
PaintForm->Shape1_40->Brush->Color=clBlue; }
else{
PaintForm->Shape1_40->Brush->Color=clRed; }
if((ddd[3] & 0x02)==0){
PaintForm->Shape1_41->Brush->Color=clBlue; }
else{
PaintForm->Shape1_41->Brush->Color=clRed; }
if((ddd[3] & 0x04)==0){
PaintForm->Shape1_42->Brush->Color=clBlue; }
else{
PaintForm->Shape1_42->Brush->Color=clRed; }
if((ddd[3] & 0x08)==0){
PaintForm->Shape1_43->Brush->Color=clBlue; }
else{
PaintForm->Shape1_43->Brush->Color=clRed; }
if((ddd[3] & 0x10)==0){
PaintForm->Shape1_44->Brush->Color=clBlue; }
else{
PaintForm->Shape1_44->Brush->Color=clRed; }
if((ddd[3] & 0x20)==0){
PaintForm->Shape1_45->Brush->Color=clBlue; }
else{
PaintForm->Shape1_45->Brush->Color=clRed; }
break; }



Ok I kinda get what it's doin but I can't get it to return a value out of the progarm at each interval so i can use it as a control. Any ideas??
Thuoght a function of some kind but how, kinda stuck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top