cannot print and perfrom other tasks one time only

I am trying to print a prompt in the serial window and input data from the serial monitor, one time only. Setup will not execute serial.print (x). how can I do this from void loop? Does it require using some special conditional structures?
thanks in advance.

Setup is where you should do this. There is no reason why it should not work in the setup function. Post your code and maybe someone can help you with it.

Here's a whole sketch that does all its Serial.print() in setup() and does nothing at all in loop().

/*
  SD card test 
   
 This example shows how use the utility libraries on which the'
 SD library is based in order to get info about your SD card.
 Very useful for testing a card when you're not sure whether its working or not.
 	
 The circuit:
  * SD card attached to SPI bus as follows:
 ** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
 ** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
 ** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
 ** CS - depends on your SD card shield or module. 
 		Pin 4 used here for consistency with other Arduino examples

 
 created  28 Mar 2011
 by Limor Fried 
 modified 9 Apr 2012
 by Tom Igoe
 */
 // include the SD library:
#include <SD.h>

// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
const int chipSelect = 4;    

void setup()
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.print("\nInitializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin 
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
  // or the SD library functions will not work. 
  pinMode(10, OUTPUT);     // change this to 53 on a mega


  // we'll use the initialization code from the utility libraries
  // since we're just testing if the card is working!
  if (!card.init(SPI_HALF_SPEED, chipSelect)) {
    Serial.println("initialization failed. Things to check:");
    Serial.println("* is a card is inserted?");
    Serial.println("* Is your wiring correct?");
    Serial.println("* did you change the chipSelect pin to match your shield or module?");
    return;
  } else {
   Serial.println("Wiring is correct and a card is present."); 
      Serial.println(".... that's all this skectch does, btw.");
  }
}

void loop(void) {
  }

So, no reason why you can't do the same.

I agree with the 2 last answers.setup() is to put the code that will be executed only 1 time. loop() is to put the code that will be repeated for ever.

hib1:
Setup will not execute serial.print (x).

IMO, that is what you need to solve. If you have not solved it already then post your code.

I've just done an interesting little experiment. This code, with Serial.begin() commented out, actually compiles. It doesn't complain when it sees the Serial.print().

void setup() {
  // put your setup code here, to run once:
  //Serial.begin(9600);  //<<<<<<<< commented out
  Serial.print("Bare min and L13 off at ");
  Serial.println(millis());
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
}

void loop() {}

So, could it be that you have a Serial.print() with no Serial.begin()?

I figured out how to request (prompt) an input from a user by typing into the serial monitor (upper window) placing the code into void loop (). The code does this without an infinite number of prompts, which was my original problem. the code prompts the user to enter a value. then it checks to see if the value is in range. it the request is not answered, the request does not repeat. if the request is answered by typing a value into the upper serial monitor window, then a new prompt is issued and the process continues.

int num_elements = 5;
int array_element;
int array[6]  = {8,1,31,41,67,77};
boolean a = true;
   void setup() 
    {
       Serial.begin(9600); // Sets up communication with the serial monitor
            }
 void loop() 
   {
    
       // prompt serial in
     if (a == true )        // set flag to identify if entry of data occured
      {
        Serial.println("enter index in serial monitor upper window, then hit enter key"); // prompt serial in
        a = !a; // toggle flag to show prompt occurred
      }
     if (Serial.available()>0)
        {
         int i = Serial.parseInt();
         if (i > num_elements)
           { 
             i = num_elements;
             // check for overrun of index i compared to array size
           }
         // Serial.setTimeout(100);
          {
            Serial.print("i ");Serial.println(i); 
            int array_element = array[i];  
            delay(10);
            Serial.print("array_element =  ");Serial.println(array_element);
            a = true;  // reset flag  to show array element has been read
         }           //   end loop
      } 
   }

In your Arduino IDE, in the Tools Menu at the top is Autoformat. It will do wonders for your code.