This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

tclvars - Variables used by Tcl

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

tclvars - Variables used by Tcl

Post by Ofloo »

http://dev.scriptics.com/man/tcl8.4/Tcl ... rs.htm#M29

hmm i have tryed to use it as a var but get always errors just curious how do i use sutch var ?? i mean it seems it isn't used like php vars or mirc vars or ... is there anything i need to define or a dll i need to load or something .. ?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

in your eggdrop's partyline, type this (assuming you have .tcl command binded) .tcl putlog $::tcl_platform(platform)

the :: means it is a global variable
Elen sila lúmenn' omentielvo
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

so if i wana use a global var i do $::varname ????

or do i need to do like "$::tcl platfrom(var)"
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

http://dev.scriptics.com/man/tcl8.4/Tcl ... ars.htm#M4

euhm how do i use this then cause it seems different ?? i tryed

$::env(varname)
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

The variables listed on that page are just regular global variables. There are two ways to use global variables inside a proc. One is to use the "global" command and the other is to start the variable with ::.

global tcl_platform
set blah $tcl_platform(hello)

or

set blah $::tcl_platform(hello)

both codes do the same thing.

In a previous question you asked: or do i need to do like "$::tcl platfrom(var)". I hope it was a typo, because the name of the array variable is tcl_platform, not "tcl platfrom". There is an underscore, not a space. And also realize that "var" has to be a valid variable listed on the help page, e.g. byteOrder, osVersion, etc And yes, capitalization is important.

In your last question you asked about $::env(varname). That works, as long as varname is a valid entry in the array. Use the names on the help page, with the exact spelling and capitalization they provide. Even then, not all of them may be defined. For instance if you're on linux, APPLE_M_FOLDER probably will not be defined heh. So first check to see if it exists using the "info exists" command.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

oh yes indeed i got the platfrom thingy to work didn't have to put it in global tho just having some trouble with env i tought it would be like that i tryed system folder on a windows machine ;) still trying tho. think i am doing something wrong syntax = same as the platfrom thingy ??

is there like a way i can show cpu ram ... disk size
Locked