One more calculation question.......
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
One more calculation question.......
Any idea how this: mon = round((24-12)/10)
could throw an error as being a double binary operator?
The same happened with :mon is round((24-12)/10)
could throw an error as being a double binary operator?
The same happened with :mon is round((24-12)/10)
Re: One more calculation question.......
Hi.
Not sure quite how you are forming your code, that is, how you are translating into proper LC syntax. The following works fine:
or:
How are you implementing this sort of thing?
Craig
Not sure quite how you are forming your code, that is, how you are translating into proper LC syntax. The following works fine:
Code: Select all
answer round((24-12)/10)
Code: Select all
put round((24-12)/10) into mon
Craig
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: One more calculation question.......
Craig's got it. In many other languages "=" is an assignment operator, resulting in millions of lost hours every year hunting down bugs related to the difference between "=" and "==" (it's sometimes fun to surf the Web with your browser's console open <g>).
LiveCode is immune to that particular productivity loss.
In LC "=" and its synonym "is" are always comparison operators, with assignment done using the "put" command.
LiveCode is immune to that particular productivity loss.

In LC "=" and its synonym "is" are always comparison operators, with assignment done using the "put" command.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: One more calculation question.......
Interestingly enough the second example you gave worked fine.
I'm trying to convert the system date to the Julian equivalent and for the most part seem to be getting
caught up on the syntax of the scripting language and finding work arounds for syntax not native to livecode.
Which is the major part of learning any new language of course...........
Is there some direction that might point to the proper syntax for programming livecode other than the documentation as
it seems a bit ambiguous.
I'm trying to convert the system date to the Julian equivalent and for the most part seem to be getting
caught up on the syntax of the scripting language and finding work arounds for syntax not native to livecode.
Which is the major part of learning any new language of course...........
Is there some direction that might point to the proper syntax for programming livecode other than the documentation as
it seems a bit ambiguous.
Re: One more calculation question.......
It takes effort and time. LC seems so accessible that you might think you could learn how to drive in a few hours. It is indeed accessible, but it is also large and rich. The User Guide is a great start, the lessons are good, the dictionary is terrific, and there are other resources, like:
http://www.hyperactivesw.com/revscriptc ... ences.html
And there is this forum. You have to practice. You likely know this.
Craig
http://www.hyperactivesw.com/revscriptc ... ences.html
And there is this forum. You have to practice. You likely know this.
Craig
Re: One more calculation question.......
Thanks Craig, I've downloaded them and no doubt refer to them often.......
again Thanks
again Thanks
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: One more calculation question.......
The Dictionary may seem ambiguous because it's a reference guide for specific syntax, and doesn't attempt to describe the overall flavor and flow of the language.Rage wrote:Is there some direction that might point to the proper syntax for programming livecode other than the documentation as
it seems a bit ambiguous.
For that check out the User Guide, accessible from the Help menu. Chapter 5 provides a very good introduction to the language.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn