找回密码
 马上注册

QQ登录

只需一步,快速开始

查看: 7345|回复: 3

求这段代码错误的具体原因

  [复制链接]
发表于 2010-5-15 18:08:11 | 显示全部楼层 |阅读模式
本帖最后由 848888888488888 于 2010-5-16 13:07 编辑
  1. bool screen[100][64]; //屏幕数组
  2. struct TheBall
  3. {
  4. int x;
  5. int y; //坐标
  6. bool UP;
  7. bool DOWN;
  8. bool RIGHT;
  9. bool LEFT;
  10. int speedx;
  11. int speedy;
  12. };
  13. TheBall ball;

  14. struct TheBlock
  15. {
  16.   int x;
  17.   int y;
  18.   int height;
  19.   int width;
  20. };
  21. TheBlock basicblock;

  22. inline void control()
  23. {
  24.    if (ButtonPressed(BTN4, true)&&ball.DOWN&&ball.UP==0)
  25.    {
  26.     ball.speedy=10;
  27.     ball.DOWN=0;
  28.    }
  29.    if (ButtonPressed(BTN3, true)&&ball.LEFT==0)ball.speedx=-3;
  30.    if (ButtonPressed(BTN2, true)&&ball.RIGHT==0)ball.speedx=3;
  31. }


  32. inline void setbasicblock()
  33. {
  34. basicblock.height=3;
  35. basicblock.width=3;
  36. }

  37. void block(int x,int y,int num)
  38. { int i;
  39.   setbasicblock();
  40.      for (i=0;i<=num;i++)
  41.      {
  42.        RectOut(x,y,basicblock.width,basicblock.height);
  43.        x+=basicblock.width;
  44.      }
  45.     for (i=x;i<=x+3*i;i++)   screen[i][y]=1; screen[i][y-3]=1;
  46.     for (i=y;i<=y-3;i--)       screen[x][i]=1;screen[x+3*num][i]=1;
  47. }


  48. void LineOutEx(int x,int y,int lg,string type)
  49. { int i,i1;
  50.     if (type=="vertical")
  51.      {
  52.        for (i=y;i<=lg+y;i++) screen[x][i]=1;
  53.        LineOut(x,y,x,y+lg);
  54.      }
  55.     if (type=="horizontal")
  56.     {
  57.      for (i=x;i<=lg+x;i++) screen[i][y]=1;
  58.      LineOut(x,y,x+lg,y);
  59.      }
  60. }

  61. void pipe(int x,int y)
  62. {
  63.   block(x-3,y+9,4);
  64.   block(x,y+6,2);
  65.   block(x,y+3,2);
  66. }

  67. inline void freezeball()
  68. {
  69. while (ball.DOWN&&ball.speedx==0&&ball.speedy==0)
  70.    {
  71.     control();
  72.     }
  73. }
  74. inline void display()
  75. {
  76.   // RectOut(basicblock.x,basicblock.y,basicblock.width,basicblock.height,0);
  77.     CircleOut(ball.x,ball.y+4,3);
  78.     CircleOut(ball.x,ball.y+4,3,0x0004);
  79. }

  80. inline void run()
  81.   {
  82.     if (ball.DOWN) ball.speedy=0;
  83.     else ball.speedy--;
  84.     ball.x+=ball.speedx;
  85.     ball.x+=ball.speedy;
  86.   }


  87. task main()
  88. {


  89. }
复制代码
在BCC里面它报错的代码(全部复制过来了):


具体的错误是(没有哪一行……):
Error:Preprocessor marco function does not match instance(#_x1,_y1,_x2,_y2,_options#acquire__LineOutMutex
恩,应该没有打漏了;
我用过几个版本的BCC,都有报错,有哪位大侠能告诉我是什么问题?
如果您觉得我的帖子对您有用,请不吝给我一个“赞”!
发表于 2010-5-15 20:25:15 | 显示全部楼层
像这种没有规范的程序,一般人都不愿意去看的
如果您觉得我的帖子对您有用,请不吝给我一个“赞”!
回复

使用道具 举报

 楼主| 发表于 2010-5-15 22:14:26 | 显示全部楼层
本帖最后由 848888888488888 于 2010-5-15 22:16 编辑

其实呢我没有怎么学过程序,而且我的程序只写了一半,所以我的程序很乱……麻烦一下大家了!
其实我也想知道怎样去粘贴代码才不会把缩进都丢了……

求求大侠们看一下!
PS:Error:Preprocessor marco function does not match instance(#_x1,_y1,_x2,_y2,_options#acquire__LineOutMutex
是什么错误呢?
如果您觉得我的帖子对您有用,请不吝给我一个“赞”!
回复

使用道具 举报

 楼主| 发表于 2010-5-16 12:58:51 | 显示全部楼层
本帖最后由 848888888488888 于 2010-5-16 14:53 编辑

总算找到了,是函数的名字不可以为LineOutEx,是个保留函数?
不过我怎么不见帮助里面有?也没有变颜色?怪
如果您觉得我的帖子对您有用,请不吝给我一个“赞”!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|中文乐高 ( 桂ICP备13001575号-7 )

GMT+8, 2024-6-3 23:32 , Processed in 0.087908 second(s), 18 queries .

Powered by Discuz! X3.5

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表