Page 1 of 1
Put the long date into field
Posted: Thu Mar 31, 2016 7:41 am
by bbhank
"put the long date into field----" only puts date in every 2nd or 3rd field. It was putting the change in every other field, then every third field, but never every field. How does one get this to work on all fields? Boxes are unchecked for having this happen.

Re: Put the long date into field
Posted: Thu Mar 31, 2016 11:54 am
by FourthWorld
I'm guessing there's more to that code than "put the long date into field----". If you post the complete relevant portion we'll be able to determine what went wrong.
Re: Put the long date into field
Posted: Thu Mar 31, 2016 1:16 pm
by bbhank
The rest of the code doesn't pertain to that.
Check this out:
set the text of field "Begins" of me to pDataArray["label 3"]
put the long date into field "Begins"
Re: Put the long date into field
Posted: Thu Mar 31, 2016 1:37 pm
by Klaus
You are quite miserly with your infos!?
So it appears like you are talking about filling a DATAGRID, right?
Try this:
...
set the text of field "Begins" of me to pDataArray["label 3"]
put the long date into field "Begins"
OF ME
...
Re: Put the long date into field
Posted: Thu Mar 31, 2016 1:41 pm
by bbhank
EXCELLENT! Works.
Thank you.
Not being miserly. This was all the relative code. Trying to keep it simple.
Help appreciated.
Re: Put the long date into field
Posted: Thu Mar 31, 2016 7:43 pm
by bbhank
That put today's date in every field. Solved part of the issue.
I am trying to change the date format in the field from year, day, the date format for MySQL, to the long date.
I didn't make that clear.

Terminology.
Re: Put the long date into field
Posted: Fri Apr 01, 2016 4:45 pm
by Klaus
bbhank wrote:That put today's date in every field. Solved part of the issue.
I am trying to change the date format in the field from year, day, the date format for MySQL, to the long date.
I didn't make that clear.

Terminology.
You did not mention this at all!
So what exactly do you want to do now?
Re: Put the long date into field
Posted: Fri Apr 01, 2016 5:05 pm
by bbhank
At this point to convert that date to the long date is needed. Your solution on putting "of me" did the trick, now I just need the date "humanized" to the long date. It's in yyyy-dd-mm.
Re: Put the long date into field
Posted: Fri Apr 01, 2016 5:26 pm
by Klaus
AHA!
OK, do like this:
...
## Presuming pDataArray["label 3"] will hold the date?
put pDataArray["label 3"] into tDate
set itemdel to "-"
## Re-arrange to normal english (non SQL) date order:
put item 3 of tDate & "/" & item 2 of tDate & "/" & item 1 of tDate into tNewDate
## Now use LCs convert command:
convert tNewDate to long date
## Now you can display the converted date:
put tNewDate into field "Begins" OF ME
...
Best
Klaus
Re: Put the long date into field
Posted: Fri Apr 01, 2016 8:23 pm
by jacque
@bbhank, I think a lot of things will be much clearer if you can get an overview of how LC works and its basic functionalities. If you read through at least the first few stacks in the Scripting Conference series it could help those ephiphanies happen a lot quicker:
http://www.hyperactivesw.com/revscriptc ... ences.html
These stacks assume no prior knowlege of LC and walk you through all the basic concepts. They have script examples with explanations. There is a Q&A session transcript at the end of each stack. The conferences took place many years ago and the stacks are a bit dated (you may still find some references to LC's previous name "RunRev") but the information is still valid. Knowing the overall picture helps a lot.
Re: Put the long date into field
Posted: Sat Apr 02, 2016 12:53 am
by bbhank
That works fine.
Thank you.