//Set STD to be in Slave Mode
  Response =  SendStbMsg(&UsbUart, STB_CMD_ANET_SLAVE, 0, (UINT8 *) 0, 0);
  if(Response) return(Response);  Response = GetUUTANetStatus(STB_CMD_INIT_ANET0_STATUS, (UINT8 *)&UUT_ANet0_Update);
  if(Response) return(Response);  Response = GetUUTANetStatus(STB_CMD_INIT_ANET1_STATUS, (UINT8 *)&UUT_ANet1_Update);
  if(Response) return(Response);
请问各位大虾不是函数为何要返回值,返回给?

解决方案 »

  1.   

    UINT32 PowerUpA65(void)
    {
      UINT32 Response;  //Switch Back to POWER SUPPLY BOARD
      BoardAddress = POWER_SUPPLY_BOARD;  Response = ResetAndEnableStop();
      if(Response) return(Response);
      //EnableStartButton();  Response = InitializeIO();
      if(Response) return(Response); //Turn on Diagnostic Enable Relay to Pull Test Pin
       //#define DIAGNOSTIC_ENABLE_RELAY       BANK4_RLY6
      Response = TurnRelayOn(DIAGNOSTIC_ENABLE_RELAY);  
      if(Response) return(Response); //Turn power relays on
      Response = TurnRelayOn(UUT_POWER_RELAY1);
      if(Response) return(Response);
      Response = TurnRelayOn(UUT_POWER_RELAY2);
      if(Response) return(Response);  GoToSleep(20);  ProgramPPSCurrent(PPS1, flNormalLineCurrent);
      ProgramPPSVolts(PPS1, flNormalLineVolts);
      EnablePPS(PPS1);  //Set sense to limit Current to UUT
      Response = SetUsbStbSenseResistor(nStartupSenseSetting);
      if(Response)
      {
        SioDone( UsbUart.CommPort );
        (int)Response = InitStbComm(&UsbUart, WSC_Baud9600, WSC_NoParity , WSC_OneStopBit, WSC_WordLength8);
        if(Response)
        {
          Response = WSC_SIOPARAMS_RESET;
          Application->MessageBox("Error on USB Open to STB", "USB Open Error", MB_OK);
        }
        Response = SetUsbStbSenseResistor(nStartupSenseSetting);
        if(Response)
        {
          Application->MessageBox("Error on USB Comm to STB", "USB Comm Error", MB_OK);
        }
      }
      if(Response) return(Response);  //Set Current Limit and Power Up Unit
      Response = PowerUsbUnitOn(nStartupCurrent); //UINT32 nStartupCurrent = 3500;
      if(Response)
      {
        Application->MessageBox("Comm Error Powering on UUT", "Power Up Comm Error", MB_OK);
        return(Response);
      }
      Response = TurnRelayOn(DIAGNOSTIC_ENABLE_RELAY);
      GoToSleep(500);  //Set STD to be in Slave Mode
      Response =  SendStbMsg(&UsbUart, STB_CMD_ANET_SLAVE, 0, (UINT8 *) 0, 0);
      if(Response) return(Response);  Response = GetUUTANetStatus(STB_CMD_INIT_ANET0_STATUS, (UINT8 *)&UUT_ANet0_Update);
      if(Response) return(Response);  Response = GetUUTANetStatus(STB_CMD_INIT_ANET1_STATUS, (UINT8 *)&UUT_ANet1_Update);
      if(Response) return(Response);  //*******************************************************************************
      //****  Toggle  *******************************************************************
      //*******************************************************************************
      strcpy(TestName,"Powering Up UUT");
      UpdateInstructionBox("Powering Up Unit to Test");
      Response = TurnRelayOn(PUSH_BUTTON_POWER_ON_RELAY);
      if(Response)
      {
        Response = TurnRelayOff(PUSH_BUTTON_POWER_ON_RELAY);
        return(Response);
      }
      GoToSleep(500);
      Response = TurnRelayOff(PUSH_BUTTON_POWER_ON_RELAY);  return(Response);
    }
    函数为何要不段返回Response?
    返回值不是只有一个吗?
      

  2.   

    用了return 以后就结束此函数了,所以不会多次return;明白?
    多看点入门书把
      

  3.   

    楼主半路出家呀?从哪里转过来的。
    基本知识还没搞清楚就开始写这种程序了,
    这程序怎么看都不像是VC里面的,应该是BC的程序吧?
      

  4.   

    大虾们,我最近在转行,很痛苦亚!
    我现在在学一个声纳测试系统。
    hyg2008 果然厉害, 是用Borland C++写的
    我现在看得书是“清华大学出版社“的可视化程序设计+谭浩强的C
    请问这两本书可以吗?
      

  5.   

    ysonic 太感谢了
    是否能对我再指导一二