Migrating to Livecode from Director

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
yurassik78
Posts: 2
Joined: Wed Aug 29, 2018 11:11 am

Migrating to Livecode from Director

Post by yurassik78 » Wed Aug 29, 2018 11:16 am

Hi everyone,
my name is Armando and I am totally new beginner. I am not a programmer, my expertise is in another field, but I like to learn programming as a hobby.
During the years I've been using Macromedia Director to develope a small application that displays some info based on the day of the year. WIth discontinuing of Director I've been looking for an alternative and I landed on Livecode.
I would like to recreate a similar program with Livecode, but before start to study it, since I'm already overwhelmed with things to do, I'd like to know if it is doable.
What basically I need is that the program read date and hour of the day and show some specific infos, no interaction with the user is needed. Is it possible?

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

Re: Migrating to Livecode from Director

Post by Klaus » Wed Aug 29, 2018 11:37 am

Hi yurassik78,

welcome to the forum!

Livecode uses the old verbose X-Talk syntax as Director did, but does not support dot syntax!
There is already a similar thread, maybe you want to take a look:
http://forums.livecode.com/viewtopic.php?f=7&t=31438
What basically I need is that the program read date and hour of the day and show some specific infos, no interaction with the user is needed. Is it possible?
YOU BET! :D

Code: Select all

...
answer ("Today is:" && the date & CR & "It is now:" && the time)
...
Here some great learning resources for the basics of LC:
http://www.hyperactivesw.com/revscriptc ... ences.html
And of course the lessons from the mothership:
http://lessons.livecode.com

Please come back often with your questions, we have lots of answers! :-)


Best

Klaus

yurassik78
Posts: 2
Joined: Wed Aug 29, 2018 11:11 am

Re: Migrating to Livecode from Director

Post by yurassik78 » Wed Aug 29, 2018 11:46 am

Hi Klaus and thanks for the quick answer, I'm just getting started and I am also catching up a bit with the forum. I already have found the BYU course that look promising and interesting for my level.
I saw the topic you quoted, but rather than to "translate" my knowledge from Director to Livecode I think it would be more proficient to just start all over to not drag some old habit in the new enviroment.

What I'd like to know is if it's possible for Livecode to read date and hours and show the correct infos. I'll go more in details, I need to make a program that shows which pharmacies are in nightshift following the day, and since the shift starts at 8 pm, if it is possible that the choice is made based on the hour.

Thanks again!

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

Re: Migrating to Livecode from Director

Post by Klaus » Wed Aug 29, 2018 12:16 pm

Hi yurassik78,
yurassik78 wrote:
Wed Aug 29, 2018 11:46 am
What I'd like to know is if it's possible for Livecode to read date and hours and show the correct infos.
please copy my example above into the message box or create a button with a mouseup handler and that line, and click the button! Exactly what you were asking for! :D

In my examply I create a longer string with strings "Strings are text inside of QUOTES in Livecode" and build-in functions and show a DIALOG with that info to the user:

Code: Select all

...
put the date into tDateOfToday
put the long data into the_long_date_with_day_of_week_etc
put the abbr date into tAbbrDate
...
same for time:

Code: Select all

...
put the time
put the long time
...
Read this up in the dicitonary to get more infos.

My example does this in a one-liner:

Code: Select all

...
## answer ("Today is:" && the date & CR & "It is now:" && the time)
## Create a string:
put "Today is: " into tLongStringWithDateAndTime
put the date after tLongStringWithDateAndTime

## Create a new line in the string:
put CR after tLongStringWithDateAndTime

## Add text for line 2 of the string:
put "It is now: " after tLongStringWithDateAndTime
put the time after tLongStringWithDateAndTime

## String is ready, now display to the user:
answer tLongStringWithDateAndTime
...
Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”