当前位置: 代码迷 >> C语言 >> [求助]gg―虚心请教bc
  详细解决方案

[求助]gg―虚心请教bc

热度:224   发布时间:2006-08-11 22:02:02.0
[求助]gg―虚心请教bc
您好!感谢您阅读我的帖子,无论您是否恢复!我将恭候!
问题如下:
1,如何在bc环境下,启用鼠标的点击功能(可以用鼠标点击菜单项或指定光标位置);
2,在bc环境下,调试过程中计算变量值出错。 是这样的:调试时Debug/Evaluate 的Evaluate段输入了整型变量 i 回车后在Result段 出现了Undefined Symbol i ??? 我已经定义了变量 i : int i;
i=strlen("abcde");

请求各位仁兄帮助!

[此贴子已经被作者于2006-8-11 22:04:45编辑过]

搜索更多相关的解决方案: Symbol  鼠标  虚心  变量  环境  

----------------解决方案--------------------------------------------------------
why used BC?

----------------解决方案--------------------------------------------------------

变量没有赋初值?还是什么的...


----------------解决方案--------------------------------------------------------
最好把你写的程序原样贴出来
这样我们才好给你合理的解释
----------------解决方案--------------------------------------------------------

哈哈 ,谢谢各位的回贴。bc 是我在嵌入式编程所需的,由于本人也是初次接触,有相当多的问题不懂!虚心请教,还望仁兄多多指教。

程序段如下:
void Xlxzjm(void)
{
struct KEYWINDOW select_kwin = {0, 0, 0, 0, NULL};
struct KEYFORMAT *vkey;
struct KEYFORMAT Memo_Select_Key[] =
{
{0,0,22,240,23,0,LINETYPE," ",""},
{1003, 146, 26, 153, 34, 1, KEY_NORMAL_F,"",""},
{1001, 162, 26, 192, 44, 4, KEY_NORMAL_F, "开始" , ""},
{1002, 200, 26, 240, 44, 4, KEY_NORMAL_F, "退出" , ""},
{-1}
};
// struct char Memo_Category[TYPE_NAME_MAXNUM];
unsigned char buff[30];
char name[30];
shi i,j,total;
shi answer,exit = 0;
// shi g;
// shi ii;
// ii=0;
shi le;
shi to;


buff[0] = 0x0;

select_kwin.key_link = (struct KEYFORMAT *)Memo_Select_Key;
ClearScreen();
DisplayVirtualkey(&select_kwin);
FillRec(0,0,240,22,BLACK,_REPLACE);
Print16zk(80,2,WHITE,(unsigned char *)"选择线路名称",0,2);
Print(2,27,"请选择:");
FillRec(61,27,15*5,17,WHITE,_REPLACE);
DrawRec(59,25,140,46,BLACK,0,_REPLACE);
strcpy(buff,Memo_Category[0].name);
strcpy(XC,Memo_Category[0].name);
// g=strlen(XC);

buff[strlen(buff)] = 0x0;
XC[strlen(XC)] = 0x0;
Print(61,27,buff);

//for(i=0;i<Total_Type;i++)
//content[i] =(char*)&Memo_Category[i].name;

do
{
vkey=SelKey(&select_kwin);
if(vkey)
{
switch(vkey->keyid)
{
case 1001:
Total_Type_bh=0;
if(OpenDbase("线路名称.dbv",(struct FIELDPROMPT *)&BZPD_Field)<0)
MessageBox((unsigned char *)"打开线路库失败!", WARN_MSGBOX);
//Warning(30,40,"打开线路库失败!");
else
{
total = GetTotalRecordNumbers();
if(total<=0)
MessageBox((unsigned char *)"输入该线路信息!", WARN_MSGBOX);
//Warning(30,40,"输入该线路信息");
else
{
for(i=1,j=0;i<=total;i++)
{
GetFieldInRecord(name,TYPE_FIELD,i);
if(strcmp(name,buff)==0)
{
GetFieldInRecord(name,XLDM_FIELD,i); //线路代码
strcpy(XLMC1[j].xldm,name); XLMC1[j].xldm[strlen(XLMC1[j].xldm)]=0x0;
GetFieldInRecord(name,QSDD_FIELD,i); //起始桩号
strcpy(XLMC1[j].qd,name); XLMC1[j].qd[strlen(XLMC1[j].qd)]=0x0;
GetFieldInRecord(name,ZDDD_FIELD,i); //截止桩号
strcpy(XLMC1[j].zd,name); XLMC1[j].zd[strlen(XLMC1[j].zd)]=0x0;
GetFieldInRecord(name,YHDM_FIELD,i); //单位代码
strcpy(XLMC1[j].yhdm,name); XLMC1[j].yhdm[strlen(XLMC1[j].yhdm)]=0x0;
GetFieldInRecord(name,LMLX_FIELD,i); //路面类型
strcpy(XLMC1[j].lmlx,name); XLMC1[j].lmlx[strlen(XLMC1[j].lmlx)]=0x0;
GetFieldInRecord(name,LMKD_FIELD,i); //路面宽度
strcpy(XLMC1[j].kd,name); XLMC1[j].kd[strlen(XLMC1[j].kd)]=0x0;

j++;
if(j==40) break;
}
}
Total_Type_bh=j;
if(!CloseCurrentFileType()) Ferror(0);
}
}
if(Total_Type_bh>0)
{
Csh(1); Csh(3); //初始化
Cur_Screen = EDIT_SCREEN;
exit=1;
}
else MessageBox((unsigned char *)"输入该线路信息!", WARN_MSGBOX); //Warning(30,40,"输入该线路信息");
break;
case 1002:
exit=1;
Quit=1;
break;
case 1003:

{

JJ_RECT rc;
struct POP_MENU_ITEM ww[11];
shi ii;
ii=0;

rc.left = 0;
rc.top = 20;
rc.right= 240;
rc.bottom = 160;

ii = sMin(10, Total_Type);//设置断点.
for(i=0; i < ii ; i++)// 单步执行 1 .循环7次
{
strcpy(ww[i].item_name, Memo_Category[i].name);
ww[i].son_menu=0;
ww[i].ID = 100 + i;
ww[i].style = NORMAL_POP_ITEM;
ww[i].enable = 1;
}
ww[i].ID = -1; //单步执行 2

le=59; to=46;//单步执行 3

answer=JJ_PopMenu(le,to,&ww[0], &rc);//单步执行 4 ,进入调用函数第一行.

if(answer!=-1) //单步执行 34
{
ClearRec(61,27,15*5,17);// 单步执行 35 出现提示框:cant not find sources file d:\1688sdk\bin\OGRAPH51.C ,如果选择对话框的"忽略" 就跳出DOS.
strcpy(buff, ww[answer-100].item_name);
strcpy(XC, ww[answer-100].item_name);
Print(61,27,buff);
}
}
break;


}
}
}while(!AllQuit() && !exit && !Quit);
}

[此贴子已经被作者于2006-8-12 13:57:11编辑过]


----------------解决方案--------------------------------------------------------
  相关解决方案