Getting short version number within IDE

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Getting short version number within IDE

Post by doobox » Wed Jun 03, 2015 10:47 am

Hi there,

I am developing an application for OS X, and would like to get the short version number of the stack in the development environment.
I can and have been doing this using :

Code: Select all

  if "cRevStandaloneSettings" is among the lines of the custompropertysets of this stack then
      put the cRevStandaloneSettings["OSX,shortVersion"] of this stack into tMyVariable
   end if
BUT! This only appears to work if I have manually selected "Livecode UI Elements In Lists" from Livecode's "View" menu.

Is there any way I can get this value, when "Livecode UI Elements In Lists" is not currently selected in the "View" menu..?
Or
Is there any way I can pragmatically select that Livecode "Livecode UI Elements In Lists" menu item, get my value and then deselect the "Livecode UI Elements In Lists" menu item?

Just any way to get the current short version of the stack within the development environment when "Livecode UI Elements In Lists" is not selected?
Kind Regards
Gary

https://www.doobox.co.uk

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

Re: Getting short version number within IDE

Post by Klaus » Wed Jun 03, 2015 4:22 pm

Hi Gary,

just made a quick test, I did NOT check "Livecode UI Elements In Lists" and
created a new stack with one button, saved it, set some of the standalone settings
and put this into the script of my lonely button:

Code: Select all

on mouseUp
   answer the cRevStandaloneSettings["OSX,shortVersion"] of this stack
end mouseUp
and saw "42", what I had entered in that field!?

So this actually works without any restriction, no idea what is going wrong on your side!?


Best

Klaus

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Getting short version number within IDE

Post by doobox » Wed Jun 03, 2015 4:30 pm

Hi Klaus,

Thank's for that. It means there is still hope :-)
Not sure why I can't get the value without that menu item selected.

Can you tell me a couple of things please?
What version did you test with?
If you look physically look at the custom property sets dropdown for your stack in the inspector, do you see "cRevStandaloneSettings" in that list, even without the menu item selected?

I don't see them in that list without the menu item selected, so assumed that was why.
I am testing in the stable 7.0.5
Very strange, as soon as I select that "Livecode UI Elements In Lists", I get my value back no problem (scratches head) :-)
Kind Regards
Gary

https://www.doobox.co.uk

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

Re: Getting short version number within IDE

Post by Klaus » Wed Jun 03, 2015 4:45 pm

Hi Gary,
What version did you test with?
LC 7.05
If you look physically look at the custom property sets dropdown for your stack in the inspector,
do you see "cRevStandaloneSettings" in that list, even without the menu item selected?
No.

Maybe this is because of your IF THEN clause which I did not use?
Try without it, does not make sense but what the egg :D


Best

Klaus

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Getting short version number within IDE

Post by doobox » Wed Jun 03, 2015 4:55 pm

That'll be it, of course, as it's not in the list when the menu item is not selected.
I'll have to work out some other logic for that instead. Most importantly, I can still get the value regardless.
Thank's for your help :-)
Kind Regards
Gary

https://www.doobox.co.uk

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: Getting short version number within IDE

Post by dave.kilroy » Wed Jun 03, 2015 7:06 pm

Hi Garry

Just to confirm, code such as the following works successfully for me whether or not "Livecode UI Elements In Lists" is selected

Code: Select all

put the cRevStandaloneSettings["ios,bundle version"] of stack tStack into tVersion
"...this is not the code you are looking for..."

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Getting short version number within IDE

Post by doobox » Wed Jun 03, 2015 8:21 pm

Thank's Dave,

It did indeed turn out to be the if condition I posted that was to blame, which makes perfect sense really when you read what it says :

Code: Select all

   if "cRevStandaloneSettings" is among the lines of the custompropertysets of this stack then
      // Not run if "Livecode UI Elements In Lists" is not selected
   end if
Kind Regards
Gary

https://www.doobox.co.uk

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: Getting short version number within IDE

Post by dave.kilroy » Wed Jun 03, 2015 8:35 pm

DOH! If I'd read your original 'if' statement properly I would have seen that! :)
"...this is not the code you are looking for..."

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

Re: Getting short version number within IDE

Post by jacque » Thu Jun 04, 2015 6:32 pm

doobox wrote:It did indeed turn out to be the if condition I posted that was to blame
I'm not so sure. When I ask for the customPropertySets of a mainstack, without choosing to show LC IDE elements, I get back a list that includes the rev* sets:

cRevStandaloneSettings
cREVGeometryCache
cREVGeneral

This returns "true":
put "cRevStandaloneSettings" is among the lines of the custompropertysets of this stack

Your test is valid. So there is something odd going on with your setup but I'm not sure what. Those property sets exist in the stack and a script that references them should not be affected by whether or not you've chosen to display them in the IDE. On my machine, there is no problem with it and I've been both getting and setting elements of that set routinely for a long time.

Are you sure that "this stack" is the mainstack when the script runs? What happens if you change your handler to this:

Code: Select all

if "cRevStandaloneSettings" is among the lines of the custompropertysets of stack "myMainstack" then
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Getting short version number within IDE

Post by doobox » Thu Jun 04, 2015 7:26 pm

Hi Jacque,

It certainly seems from what your saying that I was only partially correct that my if condition was breaking things when the show elements setting was not selected.
However, removing that if condition did solve the issue instantly.
As to "this stack" referring to the correct stack.. hmmmm, maybe something in that, but two things spring to mind.
1) regardless of which stack "this stack" was referring to, from what your saying, that referenced stack should have passed that condition regardless right.
2) I did not change "this stack" in the code inside that condition, after removing the condition, and it does indeed set the property's onto the main stack, so the main stack is and has always been "this stack". (as far as i can tell).
Kind Regards
Gary

https://www.doobox.co.uk

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Getting short version number within IDE

Post by doobox » Thu Jun 04, 2015 7:31 pm

I don't really remember my thinking in using that condition anyway.
All I was doing in essence was the same as :

Code: Select all

  if the environment is "development" then
At least I think that's what I was thinking :-)
Kind Regards
Gary

https://www.doobox.co.uk

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

Re: Getting short version number within IDE

Post by jacque » Thu Jun 04, 2015 7:50 pm

It's puzzling. The strange part is that your "if" clause was correct and should have worked, so something else is causing the failure. Unless you're morbidly curious though, I'd probably just leave off the "if" and do what you're doing now.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

doobox
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 284
Joined: Tue May 24, 2011 11:47 pm

Re: Getting short version number within IDE

Post by doobox » Thu Jun 04, 2015 8:03 pm

Year, I'v been 10 hour's trying to solve the revXML question I posted below this one. My head's now hurting to much for curiosity today :-)
replacing it with "if the environment is "development" then" works for me now.
Kind Regards
Gary

https://www.doobox.co.uk

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”