Put the long date into field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Put the long date into field

Post by bbhank » Thu Mar 31, 2016 7:41 am

"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.

:(

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9841
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Put the long date into field

Post by FourthWorld » Thu Mar 31, 2016 11:54 am

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Put the long date into field

Post by bbhank » Thu Mar 31, 2016 1:16 pm

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"

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Put the long date into field

Post by Klaus » Thu Mar 31, 2016 1:37 pm

You are quite miserly with your infos!? :D

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
...

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Put the long date into field

Post by bbhank » Thu Mar 31, 2016 1:41 pm

EXCELLENT! Works.
Thank you. :D

Not being miserly. This was all the relative code. Trying to keep it simple.
Help appreciated.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Put the long date into field

Post by bbhank » Thu Mar 31, 2016 7:43 pm

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.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Put the long date into field

Post by Klaus » Fri Apr 01, 2016 4:45 pm

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! 8)
So what exactly do you want to do now?

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Put the long date into field

Post by bbhank » Fri Apr 01, 2016 5:05 pm

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.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Put the long date into field

Post by Klaus » Fri Apr 01, 2016 5:26 pm

AHA! :D

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Put the long date into field

Post by jacque » Fri Apr 01, 2016 8:23 pm

@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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Put the long date into field

Post by bbhank » Sat Apr 02, 2016 12:53 am

That works fine.
Thank you.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”