
620 P.2d 1087 (1980)
STATE of Hawaii, Plaintiff-Appellee,
v.
William Patterson HARPER, also known as William P. HARPER, Christopher A. Davis, also known as Chris A. Davis, Defendants, and
Patrick Michael Miller, also known as Patrick M. Miller, Defendant-Appellant.
No. 7526.
Intermediate Court of Appeals of Hawaii.
December 12, 1980.
*1088 James D. Comack, Public Defender, Honolulu (Riccio M. Tanaka and Michael K. Tateishi, Deputy Public Defenders, Honolulu, on the briefs), for defendant-appellant.
Archibald C.K. Kaolulo, Deputy Pros. Atty., Honolulu (John D. Yamane, Deputy Pros. Atty., Honolulu, on the brief), for plaintiff-appellee.
Before HAYASHI, C.J., and PADGETT and BURNS, JJ.
HAYASHI, Chief Judge.
Appellant Miller appeals from a conviction for two counts of robbery in the first degree in violation of Hawaii Revised Statutes (HRS) § 708-840(1)(b). The case was tried by the judge without a jury.
The issues raised on appeal are (1) whether there is substantial evidence to support the conclusion of the trial judge that the pellet pistol used in the commission of the offense was loaded; (2) whether the pellet pistol used in the commission of the offense was a dangerous weapon within the meaning *1089 of HRS § 708-840(2);[1] and (3) whether it was error for the trial judge to find the appellant guilty as both principal and accomplice in one of the counts of robbery when the bill of particulars stated that appellant was being charged as a principal.
Finding no reversible error, we affirm the judgment below.
Appellant Miller was indicted in two counts, along with William P. Harper and Christopher A. Davis, of robbery in the first degree pursuant to HRS § 708-840(1)(b).[2] The indictment charged in the first count that the three men, on or about September 16, 1978, while in the course of committing theft and while armed with dangerous instruments, i.e., a knife and handgun, did threaten the imminent use of force against Jerome R. Schneider with the intent to compel acquiescence to the taking of or escaping with the property, thereby committing the offense of robbery in the first degree in violation of the statute. Count II alleged the same charge committed against Robert Fuentes. Pursuant to a plea bargain, both Davis and Harper pleaded guilty to one count of robbery in the first degree, Davis as to Count I and Harper as to Count II. Only appellant went to trial. After a two-day jury-waived trial appellant was convicted of both counts and sentenced to six months' imprisonment and five years' probation.
The evidence indicates as follows: On or about the 16th of September, 1978, the appellant Miller, Harper and Davis were visiting a bar called O'Pehrs' near Nimitz Highway in Honolulu where they met Schneider and Fuentes. Appellant and his companions invited the two men to accompany them to a party. Schneider and Fuentes agreed. The group then got into a car belonging to Harper's girlfriend. Harper was driving. Harper, Davis and appellant Miller rode in the front. Fuentes and Schneider rode in the back. After riding around for about half-an-hour, Harper pulled the car off the road. The person sitting in the middle then pulled out a pocket knife and the person sitting in the right front held a pellet pistol on the two men riding in the back and compelled them to surrender their marijuana and money and then ordered them to get out of the car and start running. Schneider and Fuentes complied and began running. The person sitting in the right front then fired the pellet pistol approximately three times. Schneider and Fuentes thought that blanks were being fired at them. They ran back toward the car and managed to get the license plate number of the car as appellant and his companions drove away. They called the police, who soon thereafter stopped the car containing the appellant. At that time the police recovered a pellet pistol, money and a knife.
Schneider testified that he thought the pistol was a .22 caliber pistol and both he and Fuentes testified that the sound of the weapon when fired indicated to them that it was unloaded.
Davis and Harper testified that the pistol was unloaded.
The court found as facts that Harper was driving; that Davis was in the middle; that appellant was in the right front; that Schneider and Fuentes were in the back seat; that Davis threatened Schneider with the pocket knife; that appellant threatened Schneider and Fuentes with the pistol; that at the time the appellant pointed the pistol *1090 at the victims in the vehicle the pistol was loaded; and that Davis and appellant were each armed with dangerous instruments.

1. As to whether there is substantial evidence to support the conclusion of the trial judge that the pellet pistol used in the commission of the offense was loaded

Generally, the scope of the review of appellate courts is limited to issues preserved and raised on appeal. In considering the questions properly presented for decision, the appellate court will, if necessary, review the entire record in order to arrive at a right conclusion. (24A C.J.S. Criminal Law § 1836.) A recent Pennsylvania Supreme Court case considering the appeal of convictions for murder and possession of "prohibited offensive weapons" stated that the entire trial record must be evaluated on review and
all evidence actually received must be considered, whether or not the trial court's rulings thereon were correct.
Commonwealth v. Hoskins, 485 Pa. 542, 403 A.2d 521 (1979). See also Commonwealth v. Harper, at 485 Pa. 572, at 403 A.2d 536 (1979) for similar finding.
In the case at bar, appellant cites as error the trial court's finding that the pellet gun used in the commission of the offense was loaded. Appellant contends that the pistol was unloaded and argues that the testimony in the record of both the victims and appellant's co-defendants is conclusive evidence of that fact and that the trial court was in error to rule otherwise.
However, our review of the entire record on appeal, which necessarily includes exhibits properly entered into the record as evidence, reveals that the trial court did not err in its finding that the gun was loaded. Physical examination discloses that the gun in evidence is loaded.
Upon review, we can only conclude that the victims' perceptions were based upon their mistaken, but reasonable, belief that the gun used by the appellant was a .22 caliber firearm capable of firing bullets, instead of a pellet pistol that could only fire pellets. Therefore, the sounds of the pellets being fired from the pellet pistol were perceived by them as blanks fired from a.22 caliber firearm. The testimony of Jerome Schneider supports this conclusion:
Q Now, Mr. Schneider, when this gun here was pointed at your nose and it was about a half inch away from your face, what did you think it was?
A I thought the way it looked could have been a .22 caliber pistol probably a Remington.
Q Is that the reason you gave your money?
A That's the only reason.
Thus, appellant's contention that his conviction for robbery in the first degree is reversible because the gun used was unloaded is unsupported by our review of the evidence on record. We hold that there is substantial evidence to support the finding of the trier of fact. State v. Tamanaha, 46 Haw. 245, 377 P.2d 688 (1962).

2. As to whether the court erred in finding that the loaded pellet pistol used in the commission of the offense was a dangerous weapon within the meaning of HRS § 708-840(2)

Whether the loaded pellet pistol is a "dangerous instrument", as defined by HRS § 708-840(2)[3] is a question of fact. State v. Napeahi, 57 Haw. 365, 556 P.2d 569 (1976). The trial judge found as a fact that Miller was armed with a dangerous instrument. The question on review is whether that finding is supported by substantial evidence. We hold that it is. See State v. Padilla, 57 Haw. 150, 552 P.2d 357, (1976).

3. As to whether it was error for the court to find the appellant guilty as both principal and accomplice in one of the counts of robbery when the bill of particulars stated that appellant was being charged as a principal

The last error raised by the appellant is that, because the bill of particulars filed by *1091 the prosecutor stated that appellant Miller was being charged as a principal, the court was precluded from finding him guilty as an accomplice.
The function of a bill of particulars is to enable the defendant to prepare for trial and prevent surprise and to this end the government is limited to proving what it has set forth therein. U.S. v. Haskins, (C.A.6th), 345 F.2d 111 (1965); U.S. v. Glaze (C.A.2d), 313 F.2d 757 (1963); State v. Apao, 59 Haw. 625, 586 P.2d 250 (1978). If there is a variance, the test for reversible error is whether it has affected substantial rights. If it has not, whatever variance exists is harmless error. See Jackson v. U.S. (D.C.Ct. of Appeals), 359 F.2d 260 (1966); Padgett v. U.S. (C.A.5th), 283 F.2d 244 (1960).
Appellant does not allege, nor does he have a basis to do so, that he was surprised at trial or that any substantial rights belonging to him have been abridged by the court's ruling. We find no error.
Having determined that there was no error in finding Miller an accomplice, we note that the finding that Miller was an accomplice of Davis within the purview of HRS § 702-222 (1976) is an independent basis on which to affirm Miller's conviction for robbery in the first degree. See HRS § 702-221(1) and (2)(c) (1976).
Accordingly, the judgment of the trial court is affirmed.
NOTES
[1]  HRS § 708-840(2) As used in this section, "dangerous instrument" means any firearm, or other weapon, device, instrument, material, or substance, whether animate or inanimate, which in the manner it is used or threatened to be used is capable of producing death or serious bodily injury.
[2]  HRS § 708-840 Robbery in the first degree. (1) A person commits the offense of robbery in the first degree if, in the course of committing theft:

.....
(b) He is armed with a dangerous instrument and:
(i) He uses force against the person of the owner or any person present with intent to overcome the owner's physical resistance or physical power of resistance; or
(ii) He threatens the imminent use of force against the person of anyone who is present with intent to compel acquiescence to the taking of or escaping with the property.
[3]  See Footnote 1, supra.
