
451 P.2d 845 (1969)
Charles P. MARCUM, Appellant,
v.
SHERIFF, CLARK COUNTY, Nevada, Respondent.
No. 5749.
Supreme Court of Nevada.
March 17, 1969.
James D. Santini, Public Defender, Las Vegas, for appellant.
Harvey Dickerson, Atty. Gen., Carson City, George E. Franklin, Jr., Clark County Dist. Atty., Alan R. Johns, Deputy Dist. Atty., Las Vegas, for respondent.

OPINION
BATJER, Justice.
At the preliminary hearing the appellant was held to answer upon the charge of possession and sale of narcotics. The only evidence offered by the state of Nevada was the testimony of Charles R. Foxx, a detective in the Las Vegas police department.
*846 Foxx testified that on February 1, 1968, he accompanied an unidentified informer (the detective was unable to remember the informer's name) to a residence in Las Vegas where the informer stated he could make a contact for Foxx to buy narcotics. On this initial trip the detective remained in the car and the informer entered the building alone. The following day detective Foxx was introduced to the appellant, at which time the detective represented himself as a panderer and told the appellant that he needed a large quantity of marijuana for the girls that worked for him. The appellant advised Foxx that he did not have any LSD or marijuana at that time but that he would have some available at a later date. Foxx testified that he made several trips to the appellant's home and on one occasion showed him $1,000 that he had previously obtained from a cashier at the Las Vegas Club.
At about 6:00 p.m., on February 15, 1968, detective Foxx went to the appellant's apartment. Prior to his entrance into the building fellow officers of the Las Vegas police department had surrounded the building and were ready to enter at the detective's signal. When the detective entered the apartment there were three kilos of marijuana on the table which a Tommy Joe Phelps, present at the time, had brought in from Los Angeles. Detective Foxx bought the marijuana and some pills from appellant and paid him $300 with three 100 dollar bills. The serial numbers on two of the $100 bills had been recorded earlier.
After the appellant took possession of the money, detective Foxx threw an ashtray through the window as a signal to his fellow officers, drew his revolver, and announced that all were under arrest. Immediately thereafter the waiting police officers entered the apartment and assisted the detective.
The appellant does not request that the case be dismissed, but only that the matter be remanded for a continuation of the preliminary hearing to allow him a further opportunity to cross-examine the state's witness.
It is contended that error was committed by the magistrate when he restricted the appellant's cross-examination of the state's witness on the issues of entrapment and impeachment. We disagree and affirm the judgment of the trial court.
Specifically, the appellant contends that the following restrictions on cross-examination denied him the right to perfect his defense at the preliminary hearing:
1. The court prohibited further questions on the unknown identity of the informant who took Foxx to the home of the appellant.
2. The court stopped inquiry on how much money Foxx told the appellant he had with which to make purchases.
3. The court stopped the inquiry concerning the detective's affection for the appellant and the appellant's affection for the detective.
4. The court prohibited any questions on how Foxx simulated smoking marijuana cigarettes during one of his visits to the appellant's residence prior to the sale.
5. The court stopped inquiry on how Foxx was able to obtain money from the cashier at the Las Vegas Club and why this source was used instead of obtaining the money from the coffers of the Las Vegas police department.
6. The court would not let the defense find out whether or not the detective had given the appellant a portrait of the zig-zag man, a symbol of marijuana smoking.
NRS 171.206 requires the magistrate to forthwith hold a defendant to answer in the district court if it appears from the evidence produced at the preliminary examination "That there is probable cause to believe an offense has been committed and the defendant has committed it." Beasley v. Lamb, 79 Nev. 78, 378 P.2d 524 (1963). A preliminary hearing is not a trial. State v. Holt, 47 Nev. 233, *847 219 P. 557 (1923); Overton v. State, 78 Nev. 198, 370 P.2d 677 (1962).
The appellant argues that the state's evidence raised the probability of entrapment and that he should have been permitted a far wider latitude of cross-examination to explore and establish this defense. This argument must be rejected because entrapment is an affirmative defense to be resolved at trial. Wyatt v. State, 77 Nev. 490, 367 P.2d 104 (1961), State v. Fuchs, 78 Nev. 63, 368 P.2d 869 (1962). The line of cross-examination pursued by the appellant appears to be immaterial and irrelevant to that defense and it was permissible for the magistrate to foreclose further inquiry.
A preliminary examination is not a substitute for trial. State v. Fuchs, supra. Its purpose is to determine whether a public offense has been committed and whether there is sufficient cause to believe that the accused committed it. The state must offer some competent evidence on those points to convince the magistrate that a trial should be held. The issue of innocence or guilt is not before the magistrate. That function is constitutionally placed elsewhere. The full and complete exploration of all facets of the case is reserved for trial and is not the function of a preliminary examination. It follows that a greater restriction upon the examination of witnesses is permissible at the preliminary examination stage of the criminal process than at the trial.
The appellant further contends that the limitation placed on his cross-examination interfered with his right to impeach the state's witness. We find no merit in this contention.
At a preliminary examination the credibility of a witness is one of the matters to be weighed by the magistrate. Here the appellant's right to test the credibility of the state's witness in an attempt to impeach him was in no way wrongfully curtailed. As a matter of fact the questions asked by counsel for the appellant for the purpose of impeachment were extremely repetitious.
The judgment of the trial court is affirmed and the matter is remanded for further proceedings.
COLLINS, C.J., and ZENOFF, MOW BRAY and THOMPSON, JJ., concur.
