SplitString

hi... i have a little problem whit this command...

when i try to execute the following

function pruebasplit()
string palabra=date()
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) palabra, dia, numero, de, mes, de, ano
print dia
print numero
print mes
print ano
//print palabra
end

i have no answer...(in the command window nothing is printed), but when i do de following...

function pruebasplit()
string palabra="Mie, 07 de May de 2008"
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) palabra, dia, numero, de, mes, de, ano
print dia
print numero
print mes
print ano
//print palabra
end

i have ...
Mie
07
May
2008

what is the problem???
purozongo wrote:
hi... i have a little problem whit this command...

when i try to execute the following

function pruebasplit()
string palabra=date()
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) palabra, dia, numero, de, mes, de, ano
print dia
print numero
print mes
print ano
//print palabra
end


i have no answer...(in the command window nothing is printed), but when i do de following...
function pruebasplit()
string palabra="Mie, 07 de May de 2008"
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) palabra, dia, numero, de, mes, de, ano
print dia
print numero
print mes
print ano
//print palabra
end

i have ...
Mie
07
May
2008

what is the problem???

i think it is a lenguage problem... because, when i try whit

string palabra=Secs2Date(DateTime,1)

it print

rcoles
07
Mayo
2008

any idea?
purozongo wrote:
i think it is a lenguage problem... because, ... any idea?


What is the result when you type ... print date() ... in your command window? The format of the function date() is system dependent, whereas that for Secs2Date(...) is likely not.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
when i execute

print date()

the result is

Jue, 08 de May de 2008

and... when i execute the original function (whit date()) the result was:

Jue
08
May
2008. (for today)

but the problem was whit.

Mié, 07 de May de 2008

this because my OS is in Spanish, but the idea is that the program can by executed independently the OS lenguage.



What information do you actually want? Do you need every part of the date in a separate string/variable?

If you need this to return the same values regardless of the localized version of the OS or the time/date settings in place on a particular user's computer, I'd recommend using the Secs2Date function and pass -1 as the value of the format parameter. That way you always know the format that will be returned, and you can do what you wish with it.

The one problem I can think of with doing this is that if you need to actually print the name of the day and/or name of the month, I'm not sure how you could write code that would work the same regardless of the OS or date settings. If you know that you only need to support a small and finite number of different languages, you could just use a lookup table that you define in your code. But I don't know how you could reliably support any language.
Yes,
the aim of the sequence is to create a string to name a folder for store my aquired waves.

i actually do some changes, but the final result is some like this:

function imprimefecha()
string fecha=Secs2Date(DateTime,1)
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) fecha, dia, numero, de, mes, de, ano
string foldername=numero+mes+ano
print foldername
end


thanks for the advices.

this print (for today) 14May2008, and this is independ of the OS lenguage.
And for the Folder name just add,

NewDataFolder $foldername

----
German Fernandez.
Physiology Lab.
Faculty of Science.
University of Chile.