create a point

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
Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

create a point

Post by Samuele » Tue Mar 15, 2022 3:50 pm

Hi, how can i create a point out of two variables?
for example:

Code: Select all

set _someVariable to point (_X, _Y)
(_X and _Y are two variables)
Samuele.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: create a point

Post by jmburnod » Tue Mar 15, 2022 4:23 pm

Hi,
Maybe

Code: Select all

put _X  &  "," & _Y into _someVariable
Best regards
Jean-Marc
https://alternatic.ch

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: create a point

Post by richmond62 » Tue Mar 15, 2022 4:33 pm

Do you man by point a location on the screen?

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: create a point

Post by Samuele » Tue Mar 15, 2022 4:40 pm

richmond62 wrote:
Tue Mar 15, 2022 4:33 pm
Do you man by point a location on the screen?
yes, why?
Samuele.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: create a point

Post by Samuele » Tue Mar 15, 2022 5:03 pm

jmburnod wrote:
Tue Mar 15, 2022 4:23 pm
Hi,
Maybe

Code: Select all

put _X  &  "," & _Y into _someVariable
Best regards
Jean-Marc
thanks, it worked.
Samuele.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: create a point

Post by richmond62 » Tue Mar 15, 2022 5:51 pm

Because I did not understand what you meant by 'create',
when what you meant was 'define' a point.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: create a point

Post by dunbarx » Tue Mar 15, 2022 5:56 pm

Richmond.

I think the phrase "create a point out of two variables" actually makes sense, in the, er, sense that the OP already had possession of two distinct variables, but wanted to transform them into a single valid LC point.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9285
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: create a point

Post by richmond62 » Tue Mar 15, 2022 6:17 pm

Possibly.

My 'problem', if it is a problem, is that I have a degree in Philosophy (I mean Philosophical method, not what dead people wrote), and am an EFL teacher, and so look for precision in meaning and tend to be critical of non-native speakers usage of words.

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

Re: create a point

Post by FourthWorld » Tue Mar 15, 2022 8:17 pm

Samuele wrote:
Tue Mar 15, 2022 5:03 pm
jmburnod wrote:
Tue Mar 15, 2022 4:23 pm
Hi,
Maybe

Code: Select all

put _X  &  "," & _Y into _someVariable
Best regards
Jean-Marc
thanks, it worked.
It can be even simpler: the comma concatenation need not be explicit in variable assignments - this works:

Code: Select all

put _x,_y into someVariable
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”