Check if an app is active, use AVar()
|
07-18-2015, 01:06 PM
(This post was last modified: 07-18-2015 04:04 PM by salvomic.)
Post: #1
|
|||
|
|||
Check if an app is active, use AVar()
hi,
in Effemeridi (my program for Astronomy) I would get some controls about Astro Lab 4 (the app for Astronomy by Marcel) and use some of its variables (with the kind permission of Marcel). Is it possible to get some of these things? 1. check if Astro Lab 4 is installed and it's the active app 2. call some functions by it (something like Astro_Lab_4.ListNow ...) 3. use its Avars *also* if it's not active app The purpose is to share Avars with the app without duplicate them, also if Astro Lab is not the active app. Thank you for advice and hints. Salvo for example: Code:
or Code:
∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
07-18-2015, 04:23 PM
Post: #2
|
|||
|
|||
RE: Check if an app is active, use AVar()
Hi Salvomic!
I know that ti-Nspire can do this because we can declare a library to be public or not and use it where and when we want from any document! This is what I do with Astro Lab 2. On Prime you can do Astro_Lab_4.AVars("name"):=varName and it will work. This is a sort of "public Library"... Marcel |
|||
07-18-2015, 04:34 PM
Post: #3
|
|||
|
|||
RE: Check if an app is active, use AVar()
Oups...
In fact this is OK with DATA but with function I have to try it, because one fonction call other and so on... Marcel |
|||
07-18-2015, 04:44 PM
(This post was last modified: 07-18-2015 04:44 PM by salvomic.)
Post: #4
|
|||
|
|||
RE: Check if an app is active, use AVar()
(07-18-2015 04:23 PM)Marcel Wrote: Hi Salvomic! (07-18-2015 04:34 PM)Marcel Wrote: Oups... hi Marcel, thank you, however is a good input... I tried this, just now: Code:
It works if Astro Lab 4 is active, and in Effemeridi give for planets (not Pluto for now) the same results as Astro Lab (taken by there!) But if Astro Lab 4 is not active I get error: "unmatch control word". So I need: 1. control if Astro Lab 4 is active or 2. correct syntax to work even if it isn't active. Then I'll study how use Avars from your app (it could be nice to extract some part to elaborate other calculations not already included in the app)... ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
07-18-2015, 04:55 PM
Post: #5
|
|||
|
|||
RE: Check if an app is active, use AVar()
Hi!
The DATA is the easy part but how to know if a apps is active or not? I don't know. I will try... Marcel |
|||
07-18-2015, 05:52 PM
Post: #6
|
|||
|
|||
RE: Check if an app is active, use AVar()
[quote='salvomic' pid='39335' dateline='1437237850']
...and use this line Code:
is insecure! if the program doesn't exist the program won't compile and gives a syntax error i.e. Code:
∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
07-18-2015, 08:59 PM
(This post was last modified: 07-18-2015 10:58 PM by StephenG1CMZ.)
Post: #7
|
|||
|
|||
RE: Check if an app is active, use AVar()
Could you use IFERR?
Something like: Iferr astro... then // not there or other err Else Astro... // all ok Endif Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
07-18-2015, 10:09 PM
Post: #8
|
|||
|
|||
RE: Check if an app is active, use AVar()
(07-18-2015 08:59 PM)StephenG1CMZ Wrote: Could you use IFERR? yes Stephen, using IFERR, this seems to work (but...) Code:
It executes the 5 lines if Atro Lab is active, and changing the IFERR line like IFERR EXPR("Astro_Lab_4xxxxxx()") THEN temp:=0; // change nothing it executes ...nothing, as expected. But if Astro Lab 4 is not active I got always the "unmatch control word" error: I don't understand from where it comes... However now with IFERR we can control if the syntax is ok, but not still *if* the app there is or it's active. Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
07-19-2015, 06:58 AM
Post: #9
|
|||
|
|||
RE: Check if an app is active, use AVar()
hello
Each application has its Avars list. Add an Active Variable : = "name" or number. In Astro: Avars "Active" : = " Astrolab " in Function Avars "Active" : = "Function" Etc ... If Avars "Active" not exist, write Code:
|
|||
07-19-2015, 03:28 PM
Post: #10
|
|||
|
|||
RE: Check if an app is active, use AVar()
(07-19-2015 06:58 AM)Tyann Wrote: hello I'm trying, thank you. The problem seems still the "unmatch control word" error when Astro Lab is not active, executing its function in the program: also the ELSE path of IFERR gives error and I don't know how to avoid it... Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
07-19-2015, 04:56 PM
Post: #11
|
|||
|
|||
RE: Check if an app is active, use AVar()
found!
thank also to Tyan input. The "unmatch control word" was generated by an error of mine: it was recalled a function of Astro Lab 4 with a similar name, not mine! corrected a "J" in "j" it works also when Astro Lab is not installed with a code like this one: Code:
AVars "lieu" is in Astro Lab 4, we control if it exists, and if not nothing will be changed, otherwise it's used the function PlanetCoordinates() in Astro Lab 4 and the result will be treated into Effemeridi, in some parts: very interesting! I advice to install and use Astro Lab 4, to have a better experience with Effemeridi also. Salvo ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: