Omnis Studio - Multi Library Tasks

Brian O'Sullivan brian.os at verizon.net
Tue Jan 13 20:55:22 EST 2015


On Jan 13, 2015, at 2:31 PM, Stephane Pras <stephane.pras at noos.fr> wrote:

> And same for LibB. Point (2) from paragraph below is gone, I'm only left
> with (1) MyLib's Startup_Task and (3) the $activate in LibA and LibB (don't
> know where else to put it) to enforce the use of the proper datafile at each
> active task switch.
> 
> I can open and close both libraries at will, and each one is running fine
> independently of the other (as required). LaunchA and LaunchB tasks were
> overkill. I was mislead by Omnis Programming manual p.46 etc. I understood
> additional task classes had to be created, while the Startup_Task instances
> of each library are enough to do the job.

Hello Stephane,
Glad to be of help! Tasks are not the most obvious concept to learn.

The best place to set $autoactivate is in the $construct method of the startup tasks of LibA and LibB. In this location you can write it as:

 Do $cinst.$autoactivate.$assign(kTrue)

Within any method in the task class, $cinst will refer to the task instance. It’s like the task instance tells Omnis: assign kTrue to “MY” $autoactivate property. I like to use such $c “shortcuts” whenever possible because they allow me to write shorter notation strings and also minimize the dependence on developer-defined names that I may decide to change at a later date (and not remember to Find & Replace!).

Best regards,
-brian o’sullivan; bear, DE (USA)







More information about the omnisdev-en mailing list