if you reach base on an error is it an at bat
Error (baseball) An error does not count as a hit but still counts as an at bat for the batter unless, in the scorer's judgment, the batter would have reached first base safely but one or more of the additional base(s) reached was the result of the fielder's mistake. In that case, the play will be scored both as a hit (for the number of bases the fielders should have limited the batter to) and an error. However, if a batter is judged to have reached base solely because of a fielder's mistake, it is scored as a "hit on error," and treated the same as if the batter had been put out, hence lowering his batting average.
Batting order (baseball) In baseball, the batting order or batting lineup is the sequence in which the members of the offense take their turns in batting against the pitcher. The batting order is the main component of a team's offensive strategy. In Major League Baseball, the batting order is set by the manager, who before the game begins must present the home plate umpire with two copies of his team's lineup card, a card on which a team's starting batting order is recorded. The home plate umpire keeps one copy of the lineup card of each team, and gives the second copy to the opposing manager. Once the home plate umpire gives the lineup cards to the opposing managers, the batting lineup is final and a manager can only make changes under the Official Baseball Rules governing substitutions.[1] If a team bats out of order, it is a violation of baseball's rules and subject to penalty.