Hi Lennox,
Not sure if this is relevant, but RB 07R1 has ( i think, changed the
valid strings). From LR:
"The Text parameter must be a valid String representation of a Date.
You can use the slash, the dash, the period, or the space to separate
the Month, Day, and Year. For example, the following are valid String
representations: 12/14/1341, 12-14-1341, 12.14.1341, 14Dec1341,
14.Dec.1341, and 14 Dec. 1341. "
Are you sure your string matches one of those above.
Michael.
On Feb 11, 2007, at 8:04 PM, Lennox Jacob wrote:
Thanks Norman,
But I have been trying this and many of my modifications of it
// this date is like Tuesday, August 12, 1980
dim weekday as string
dim month as string
dim year as string
weekday = nthfield(dateStr,",",1)
month = nthfield(dateStr,",",2)
year = nthfield(dateStr,",",3)
dateStr = weekDay + ", " + month + " " + year
to get from Tuesday, August 12, 1980 to Tuesday, 12 August 1980 or
12/08/1980, both of which are acceptable, but I was not able to do so.
Kindly assist.
Thanks.
Lennox.
Norman Palardy <[EMAIL PROTECTED]> wrote:
On Feb 11, 2007, at 3:39 PM, Lennox Jacob wrote:
Thanks Russ and Norman,
So, I use a text editor and manually change Tuesday, August 12,
1980 to Tuesday, 12 August 1980 and all is well. When I save and
then reopen there is no problem because the formatting has already
been corrected.
It means that I have to change the date of birth manually when I
want to open any old file.
That is what I would like to get done, changing that old format to
the new format, seemlessly, in the background.
Any advice or recommendations.
If you read the "date" in a s a string see if it has 2 commas and if
it does you know it is the old format
Delete the second comma and away you go
something like
// assuming the date of interest is in dateStr already
select case countFields(dateStr,",")
case 2
// this date is already like Tuesday, 12 August 1980
case 3
// this date is like Tuesday, August 12, 1980
dim weekday as string
dim month as string
dim year as string
weekday = nthfield(dateStr,",",1)
month = nthfield(dateStr,",",2)
year = nthfield(dateStr,",",3)
dateStr = weekDay + ", " + month + " " + year
else
// something else
end select
// now use parse date on dateStr
_______________________________________________
Unsubscribe:
REAL Software has decided to consolidate this mailing list with the
online Forums. On Monday, February 12, 2007, this mailing list
will no longer be active. We encourage you to continue your
REALbasic and REAL SQL Server discussions on the Forums. If you
are not presently a member of the forum, please sign up today at .
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
_______________________________________________
Unsubscribe:
<[EMAIL PROTECTED]>
REAL Software has decided to consolidate this mailing list with the
online Forums. On Monday, February 12, 2007, this mailing list
will no longer be active. We encourage you to continue your
REALbasic and REAL SQL Server discussions on the Forums. If you
are not presently a member of the forum, please sign up today at
<http://forums.realsoftware.com>.
_______________________________________________
Unsubscribe:
<[EMAIL PROTECTED]>
REAL Software has decided to consolidate this mailing list with the online Forums.
On Monday, February 12, 2007, this mailing list will no longer be active. We
encourage you to continue your REALbasic and REAL SQL Server discussions on the
Forums. If you are not presently a member of the forum, please sign up today at
<http://forums.realsoftware.com>.