Page 1 of 1 1
Topic Options
#196035 - 2009-09-23 08:00 AM SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
 Code:
Macro CURDIR

;Author		Richard von Mallesch (It took my meds)
;Action		Returns the current directory
;Version	1.0
;Date       	23/09/2009

	Dim $Env
	Imports $Env = System.Environment
	$CURDIR = $Env.CurrentDirectory
	
EndMacro

Macro CRLF

;Author		Richard von Mallesch (It took my meds)
;Action		Returns a new line
;Version	1.0
;Date       	23/09/2009

	Dim $Env
	Imports $Env = System.Environment
	$CRLF = $Env.NewLine
	
EndMacro

Macro DOMAIN

;Author		Richard von Mallesch (It took my meds)
;Action		Returns the domain or workgroup the computer belongs to
;Version	1.0
;Date       	23/09/2009

	Dim $Env
	Imports $Env = System.Environment
	$DOMAIN = $Env.UserDomainName
	
EndMacro

Macro TICKS

;Author		Richard von Mallesch (It took my meds)
;Action		Returns the number of milliseconds elapsed since computer was last booted
;Version	1.0
;Date       	23/09/2009

	Dim $Env
	Imports $Env = System.Environment
	$TICKS = $Env.TickCount
	
EndMacro

Macro USERID

;Author		Richard von Mallesch (It took my meds)
;Action		Returns the current user's Windows NT user ID
;Version	1.0
;Date       	23/09/2009

	Dim $Env
	Imports $Env = System.Environment
	$USERID = $Env.UserName
	
EndMacro

Macro WKSTA

;Author		Richard von Mallesch (It took my meds)
;Action		Returns the computer name 
;Version	1.0
;Date       	23/09/2009

	Dim $Env
	Imports $Env = System.Environment
	$WKSTA = $Env.MachineName
	
EndMacro



Edited by It_took_my_meds (2009-09-23 09:25 AM)
Edit Reason: Added headers

Top
#196036 - 2009-09-23 09:02 AM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: It_took_my_meds]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Please update the macro with a header as described in the forum Guidelines post.
Top
#196038 - 2009-09-23 09:26 AM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: Richard H.]
It_took_my_meds Offline
Hey THIS is FUN
*****

Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
OK, done.
Top
#196044 - 2009-09-23 03:52 PM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: It_took_my_meds]
BoForce Offline
Fresh Scripter
**

Registered: 2005-10-22
Posts: 36
Loc: Leeuwarden, The Netherlands
Very nice.
\:\)

Top
#196093 - 2009-09-26 01:33 PM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: BoForce]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
crlf is not the same as new line.

it's a hard coded CRLF. for new line standard kix has the ? command.

also,
this listing is missing it's requirements header section.
and as they are tested on development version, also summary/notes/comments section should provide with which version it was tested and proven working with.

The header parts that are common, can (and imo should) be combined right at the top.
_________________________
!

download KiXnet

Top
#196098 - 2009-09-26 02:19 PM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
also, missing example.
_________________________
!

download KiXnet

Top
#196100 - 2009-09-26 02:45 PM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: Lonkero]
WvS Offline
Fresh Scripter
*****

Registered: 2009-05-30
Posts: 42
Loc: Netherlands
The description of @CRLF might be incorrect, but it's implementation is correct.
System.Environment.NewLine is equivalent to CRLF on the Windows platform (http://msdn.microsoft.com/en-us/library/system.environment.newline.aspx).

Top
#196103 - 2009-09-26 08:50 PM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: WvS]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure, so the author is the also missing the comment that this .net macro list is only for windows machines.
_________________________
!

download KiXnet

Top
#196104 - 2009-09-26 09:46 PM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: Lonkero]
WvS Offline
Fresh Scripter
*****

Registered: 2009-05-30
Posts: 42
Loc: Netherlands
For the sake of completeness, I would also suggest adding comments about the supported .net frameworks, whether silverlight is supported, the computational complexity of the function and the current position of the earth relative to the moon.
Top
#196105 - 2009-09-26 11:36 PM Re: SteelKiX Macros: USERID, WKSTA, TICKS, DOMAIN, CRLF, CURDIR [Re: WvS]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I don't see those as required.

but if one wants to really make his header shine, then maybe those optional parts could be left non-omitted.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.066 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org