PB_TOOL_Word and environment variables

Just starting out? Need help? Post your questions and find answers here.
epidemicz
User
User
Posts: 86
Joined: Thu Jan 22, 2009 8:05 am
Location: USA
Contact:

PB_TOOL_Word and environment variables

Post by epidemicz »

Ok guys I found some cool code that sparked my interest the other day browsing the forums. You can see exactly it's purpose here: http://www.purebasic.fr/english/viewtop ... =MSDN+HELP.

The code:

Code: Select all

Define.s Word
Word = GetEnvironmentVariable("PB_TOOL_Word")
If Word
  If Right(Word, 1) = "_"
    Word = Left(Word, Len(Word) -1)
  ElseIf Left(Word, 1) = "#"
    Word = Right(Word,Len(Word) -1)
  EndIf
  RunProgram("rundll32.exe","url.dll,FileProtocolHandler http://www.google.de/search?q=site:msdn.microsoft.com+msdn+win32+" + Word + "&btnI=true", "")
EndIf
Now, for demonstration purposes, lets use some more code I found.

This code will display all of the environment variables:

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
My question:
Why doesn't PB_Tool_Word show up in the list of environment variables? Why aren't any of the other variables in the help file showing up? If these aren't available with ExamineEnvironmentVariables(), then how would we find them? For instance if there was another program we wanted to see their variables, would that be possbile, or do we just have to be told what they are? :? :?
PB_TOOL_IDE - Full path and filename of the IDE
PB_TOOL_Compiler - Full path and filename of the Compiler
PB_TOOL_Language - Language currently used in the IDE
PB_TOOL_FileList - A list of all open files in the IDE, separated by Chr(10)

PB_TOOL_Debugger - These variables provide the settings from the Compiler Options
PB_TOOL_InlineASM window for the current source. They are set to "1" if the option
PB_TOOL_Unicode is enabled, and "0" if not.
PB_TOOL_Thread
PB_TOOL_XPSkin
PB_TOOL_OnError

PB_TOOL_SubSystem - content of the "Subsystem" field in the compiler options
PB_TOOL_Executable - same as the %COMPILEFILE token for the commandline
PB_TOOL_Cursor - same as the %CURSOR token for the commandline
PB_TOOL_Selection - same as the %SELECTION token for the commandline
PB_TOOL_Word - same as the %WORD token for the commandline

PB_TOOL_MainWindow - OS handle to the main IDE window
PB_TOOL_Scintilla - OS handle to the Scintilla editing component of the current source
Image
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PB_TOOL_Word and environment variables

Post by ts-soft »

This environment variables a set by the IDE, so only available for processes started by the IDE.
Your program start from explorer!
epidemicz
User
User
Posts: 86
Joined: Thu Jan 22, 2009 8:05 am
Location: USA
Contact:

Re: PB_TOOL_Word and environment variables

Post by epidemicz »

Wow, I gotcha now. Thanks ts-soft, and thanks for the msdn help tool I use it all the time, saves lots of typing :D
Image
Post Reply