declaration problem

Hi im trying to declare a public prog_char variable inside a method like below but im getting the following error:

error: expected primary-expression before 'public'

Here's the code:

public const prog_char ssid[] PROGMEM = {(prog_char)*(getSSID())};

*SSID is a method that returns the SSID of the network as an integer.

'public' inside a method? can you explain what it is you want to do, and post the rest of the class declaration?

Program memory is loaded when the sketch is loaded, so you can't modify it once your program is running.

Hi Thanks for the reply, I understand whats wrong.

What I was really trying todo is this: I have a WiShield (form Asynclabs) and normally before you initialize it you have to declare all the variables as follows.

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,2};      // IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1};      // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0};      // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"ASYNCLABS"};            // max 32 bytes

unsigned char security_type = 0;      // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"12345678"};      // max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,      // Key 0
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      // Key 1
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      // Key 2
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00      // Key 3
                        };

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------

void setup() {....}

void loop(){....}

etc...

What im trying to do is a device where the user sends the parameters via the serial connection. Its ok forth ip and that but the SSID for example is constant so can only be declared once. But if I declare it in a method its local to the method so it wont work. Thanks for any advice.

Cyril