Is library running on Citrix or Terminal Server? - Testing on existence/value of environment variable SESSIONNAME - Solution

bub buppeke at gmail.com
Sat Jan 27 02:04:36 EST 2018


Hey Das, hope all is well, my mail had nothing to do with the Studio
sessionname.  It was about an environment variable of the windows operating
system.

Bruno

On Jan 27, 2018 5:26 AM, "Das Goravani" <das at goravani.com> wrote:

>
> In 8.1.3 the following notation gives the session name, or first one if
> multiple
>
> Do llist.$define(lSessionName)
> Do $root.$sessions.$appendlist(llist,$ref.$name)
> Calculate lSessionName as lst(llist,1,lSessionName)
>
> llist is a local variable of list type
> lSessionName is character
>
>
>
> > On Jan 26, 2018, at 7:40 AM, bub <buppeke at gmail.com> wrote:
> >
> > Hey all,
> >
> > I would love to find out if my library is running on Citrix or Terminal
> Server.
> >
> > Apparently, the environment variable SESSIONNAME is only defined on
> Citrix or Terminal Server so that would be a way to find it out, even more
> specific
> >
> > Citrix client => SESSIONNAME starts with ICA
> > Rdp client => SESSIONNAME starts with rdp
> > Console session => SESSIONNAME starts with console
> >
> > Is there any DLL that can provide the value of an envirnoment variable
> like SESSIONNAME?
> >
> > Ok, just did some more effort in scrolling through historic posts and
> found similar construction to get username (which i changed now to
> sessionname)
> >
> > Register DLL ('kernel32','GetEnvironmentVariableA','ICCM')
> > Call DLL ('kernel32','GetEnvironmentVariableA','
> SESSIONNAME',%%SESSIONNAME,255)
> >
> > So solution found, happy to share, might me be interesting for some
> >
> > Bruno.
> >
> >
> >
> >
> >
> > ---
> > This email has been checked for viruses by Avast antivirus software.
> > https://www.avast.com/antivirus
> >
> > _____________________________________________________________
> > Manage your list subscriptions at http://lists.omnis-dev.com
> >
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>



More information about the omnisdev-en mailing list