getting the user name

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

getting the user name

Post by dunbarx »

I have always wondered about the (large) portion of the dictionary that is not in the, er, dictionary. The "messageMessages" comes to mind.

But simply finding the "username" is not straightforward, at least I believe. ChatGPT turned me on to "$USER" which gives the login name for my machine. Anyone know of a better way? It seems rather useful a tool, so one can tailor a stack to specific users, like I just needed to do.

Craig
SparkOut
Posts: 2989
Joined: Sun Sep 23, 2007 4:58 pm

Re: getting the user name

Post by SparkOut »

In the Script Editor, you can toggle the visibility of Global (or System?) variables. Then in the variables list you'll see a lot of entries beginning with $ that provide lots of information about the user environment. They're mostly easy enough to work out what each provides, but I think they're in the dictionary.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10509
Joined: Wed May 06, 2009 2:28 pm

Re: getting the user name

Post by dunbarx »

Sparkout.

I know about those variables; they get in my way for the most part. But I wish they were in the dictionary so I could search for them and also be presented with similar types. There are only a handful of entries that begin with "$".

I do not understand why the dictionary does not hold the entirety of the lexicon, even if there were a few filters to separate the several types into groups.

Craig
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10105
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: getting the user name

Post by FourthWorld »

dunbarx wrote: Wed Jul 29, 2026 4:49 am I do not understand why the dictionary does not hold the entirety of the lexicon, even if there were a few filters to separate the several types into groups.
Technically, those aren't LC variables. They're provided by the OS, and may vary from system to system, and sometimes between OS versions.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Post Reply