Page 1 of 1

Get Environment variables

Posted: Thu May 28, 2009 1:28 pm
by doctorized
This is an other code I 've writen.
Get all the environment variables from every OS (Tested under Windows but it should work fine under other operating Systems. Tell if not.)

Code: Select all

; Author: Wicker Man
; Date: May 22 2009
; OS: All
; Demo: No
; More codes at: www.geocities.com/kc2000labs/pb/pb.htm

If OpenWindow(0, 0, 0, 640, 520, "Environment Variables", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
	If CreateGadgetList(WindowID(0))
		ListIconGadget(0,10,10,621,500,"Variable",200,#PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect)
	EndIf
	
	AddGadgetColumn(0,1,"Data",400)
	If ExamineEnvironmentVariables()
		While NextEnvironmentVariable()
			AddGadgetItem(0,-1,EnvironmentVariableName()+Chr(10)+EnvironmentVariableValue())
		Wend
	EndIf

  Repeat
    EventID = WaitWindowEvent()

    If EventID = #PB_Event_CloseWindow
      Quit = 1
    EndIf

  Until Quit = 1
  
EndIf

Posted: Thu May 28, 2009 2:07 pm
by AND51
An amaaaaaaaaazing awesome code you have there, mate! :shock:
Good for people who are to shy to press F1 and look up ExamineEnvironmentVariables(). There's your code already implemented as example code. :wink:

Posted: Thu May 28, 2009 2:15 pm
by doctorized
AND51 wrote:An amaaaaaaaaazing awesome code you have there, mate! :shock:
Good for people who are to shy to press F1 and look up ExamineEnvironmentVariables(). There's your code already implemented as example code. :wink:

There is people that do not know the contained commands. It is a way to inform them. No need to be spiteful with me. I just try to help.

Posted: Thu May 28, 2009 2:23 pm
by Fluid Byte
doctorized wrote:There is people that do not know the contained commands.
Are you serious? Will you post an code example from the help here every time someone is to lazy to RTFM?
doctorized wrote:It is a way to inform them. No need to be spiteful with me. I just try to help.
Well, I can understand him. You basically just copied the example from the help so what's the point?

Posted: Thu May 28, 2009 5:08 pm
by AND51
Fluid Byte wrote:You basically just copied the example from the help so what's the point?
No... The example in the help outputs the variables and their value in a console...
He changed the output to a GUI. :wink:

Posted: Fri May 29, 2009 1:57 pm
by Seymour Clufley
AND51 and Fluid Byte, aren't you being a bit unkind?

Posted: Fri May 29, 2009 2:18 pm
by Fluid Byte
Seymour Clufley wrote:AND51 and Fluid Byte, aren't you being a bit unkind?
No but German ...

Seriously, what is the point of posting identical examples from the help just because some idiots are to lazy to read the ****ing manual? This is insane!

Posted: Fri May 29, 2009 3:00 pm
by Fred
Please calm down, there is no need to harsh for such things.