PDA

View Full Version : Open Workspace program



David Martinko
19-Apr-2005, 02:29 PM
Here's a free program. I like to be able to goto a workspace folder right
away to do things. I feel limited by the FILE | OPEN SOURCE FILE from within
the IDE so I added this to the UTILITIES menu.

See image below. All I do is click an icon to open the workspace in window's
explorer. I hope this helps others as much as it will me.

//AB/ Project Open Workspace
//AB/ Object prj is a Application_Project
//AB/ Set Size to 150 220
//AB/ Set ProjectName to "Open Workspace"
//AB/ Set ProjectFileName to "OpenWorkspace.src"
//AB/ Set GenerateFileName to "NONAME"

//AB-IgnoreStart
Use DfAllEnt.pkg
#REPLACE CURRENT$WORKSPACE ""

// Project Object Structure
// oApplication is a cApplication
// oRegistry is a cRegistry

// Register all objects
Register_Object oApplication
Register_Object oRegistry
//AB-IgnoreEnd

//AB-IgnoreStart
Use cApplication.pkg
//AB-IgnoreEnd

Object oApplication is a cApplication
//AB/ Set Location to 4 5
//AB-StoreStart
Object oRegistry is a cRegistry
End_Object // oRegistry

Procedure OnCreate
Boolean bOpened
String sVal
Integer iOpened
Set phRootKey of oRegistry To HKEY_CURRENT_USER
Get OpenKey of oRegistry "Software\Data Access Worldwide\Visual
Dataflex\10.1\Workspaces" To bOpened
If (bOpened) Begin
If (ValueExists(oRegistry, "Current Workspace")) Get ReadString
of oRegistry "Current Workspace" To sVal
Send CloseKey of oRegistry
Send DoOpenWorkspace sVal
Move (psHome(phoWorkspace(Self))) to sVal
RunProgram background ('c:\Windows\explorer.exe "'+sVal+'"')
End
End_Procedure
//AB-StoreEnd
End_Object // oApplication
//AB-StoreStart
Abort
//AB-StoreEnd
//AB/ End_Object // prj


--
David Martinko
Redeemed Software
248-535-7495
RedeemedSoftware(SHIFT+2)Hotmail(PERIOD)com
www.redeemedsoftware.com

Curtis Krauskopf
19-Apr-2005, 05:31 PM
David,

That's a great tool. Thanks for sharing, David.

Curtis

Clayton
20-Apr-2005, 08:20 AM
Hi David,

Thanks for sharing your code.

I'm doing this in a different way for a long time, I add an entry to run the
windows explorer opening the desired folder. The "Command-Line" field is
filled with the following command: C:\Windows\Explorer.Exe C:\AppFolder

In this way, obviously I need to add one entry for each workspace (or
folder).

Thanks again.

Regards.

[]'s
Clayton Schirmer
Ômega Sistemas Ltda. Acesse: www.omegasistemas.com
E-mail e MSN: clayton@omegasistemas.com
ICQ: 281012213
Skype: clayton_schirmer

"David Martinko" <RedeemedSoftware@Hotmail.com> escreveu na mensagem
news:4xR0qYRRFHA.2052@dacmail.dataaccess.com...
Here's a free program. I like to be able to goto a workspace folder right
away to do things. I feel limited by the FILE | OPEN SOURCE FILE from within
the IDE so I added this to the UTILITIES menu.

See image below. All I do is click an icon to open the workspace in window's
explorer. I hope this helps others as much as it will me.

//AB/ Project Open Workspace
//AB/ Object prj is a Application_Project
//AB/ Set Size to 150 220
//AB/ Set ProjectName to "Open Workspace"
//AB/ Set ProjectFileName to "OpenWorkspace.src"
//AB/ Set GenerateFileName to "NONAME"

//AB-IgnoreStart
Use DfAllEnt.pkg
#REPLACE CURRENT$WORKSPACE ""

// Project Object Structure
// oApplication is a cApplication
// oRegistry is a cRegistry

// Register all objects
Register_Object oApplication
Register_Object oRegistry
//AB-IgnoreEnd

//AB-IgnoreStart
Use cApplication.pkg
//AB-IgnoreEnd

Object oApplication is a cApplication
//AB/ Set Location to 4 5
//AB-StoreStart
Object oRegistry is a cRegistry
End_Object // oRegistry

Procedure OnCreate
Boolean bOpened
String sVal
Integer iOpened
Set phRootKey of oRegistry To HKEY_CURRENT_USER
Get OpenKey of oRegistry "Software\Data Access Worldwide\Visual
Dataflex\10.1\Workspaces" To bOpened
If (bOpened) Begin
If (ValueExists(oRegistry, "Current Workspace")) Get ReadString
of oRegistry "Current Workspace" To sVal
Send CloseKey of oRegistry
Send DoOpenWorkspace sVal
Move (psHome(phoWorkspace(Self))) to sVal
RunProgram background ('c:\Windows\explorer.exe "'+sVal+'"')
End
End_Procedure
//AB-StoreEnd
End_Object // oApplication
//AB-StoreStart
Abort
//AB-StoreEnd
//AB/ End_Object // prj


--
David Martinko
Redeemed Software
248-535-7495
RedeemedSoftware(SHIFT+2)Hotmail(PERIOD)com
www.redeemedsoftware.com

Anders Öhrt
20-Apr-2005, 09:09 AM
If you have all your workspaces in the same subdirectory (like I do,
C:\Dev), you can do that by adding "explorer.exe c:\dev\<WORKSPACE>".

// Anders

Jim Albright
20-Apr-2005, 12:32 PM
David,

Works, but since I don't have v10.1, I changed to v10.0.

Jim
"David Martinko" <RedeemedSoftware@Hotmail.com> wrote in message
news:4xR0qYRRFHA.2052@dacmail.dataaccess.com...
> Here's a free program. I like to be able to goto a workspace folder right away to do things. I
> feel limited by the FILE | OPEN SOURCE FILE from within the IDE so I added this to the UTILITIES
> menu.
>
> See image below. All I do is click an icon to open the workspace in window's explorer. I hope this
> helps others as much as it will me.
>
> //AB/ Project Open Workspace
> //AB/ Object prj is a Application_Project
> //AB/ Set Size to 150 220
> //AB/ Set ProjectName to "Open Workspace"
> //AB/ Set ProjectFileName to "OpenWorkspace.src"
> //AB/ Set GenerateFileName to "NONAME"
>
> //AB-IgnoreStart
> Use DfAllEnt.pkg
> #REPLACE CURRENT$WORKSPACE ""
>
> // Project Object Structure
> // oApplication is a cApplication
> // oRegistry is a cRegistry
>
> // Register all objects
> Register_Object oApplication
> Register_Object oRegistry
> //AB-IgnoreEnd
>
> //AB-IgnoreStart
> Use cApplication.pkg
> //AB-IgnoreEnd
>
> Object oApplication is a cApplication
> //AB/ Set Location to 4 5
> //AB-StoreStart
> Object oRegistry is a cRegistry
> End_Object // oRegistry
>
> Procedure OnCreate
> Boolean bOpened
> String sVal
> Integer iOpened
> Set phRootKey of oRegistry To HKEY_CURRENT_USER
> Get OpenKey of oRegistry "Software\Data Access Worldwide\Visual Dataflex\10.1\Workspaces"
> To bOpened
> If (bOpened) Begin
> If (ValueExists(oRegistry, "Current Workspace")) Get ReadString of oRegistry "Current
> Workspace" To sVal
> Send CloseKey of oRegistry
> Send DoOpenWorkspace sVal
> Move (psHome(phoWorkspace(Self))) to sVal
> RunProgram background ('c:\Windows\explorer.exe "'+sVal+'"')
> End
> End_Procedure
> //AB-StoreEnd
> End_Object // oApplication
> //AB-StoreStart
> Abort
> //AB-StoreEnd
> //AB/ End_Object // prj
>
>
> --
> David Martinko
> Redeemed Software
> 248-535-7495
> RedeemedSoftware(SHIFT+2)Hotmail(PERIOD)com
> www.redeemedsoftware.com
>
>
>

Pieter van Dieren
3-May-2005, 08:21 AM
Nice one David.
Thanks.

For those of you who (like me) prefer the Windows Explorer view instead of
the single-paned view (My Computer), change the line

RunProgram background ('c:\Windows\explorer.exe "'+sVal+'"')

into:

RunProgram background ('c:\Windows\explorer.exe /e, "'+sVal+'"')

--

Pieter

David Martinko
23-Feb-2006, 01:00 AM
Here's a free program. I like to be able to goto a workspace folder right
away to do things. I feel limited by the FILE | OPEN SOURCE FILE from within
the IDE so I added this to the UTILITIES menu.

---------------------------------------
NEW AND IMPROVED!!!
now you can create this program once and run it for all newer versions of
VDF you are using. It relies entirely on the registry. You pass it the
version you are using and it opens the current workspace for that version.

For VDF10.1 studio, you'll use this
OpenWorkspace.EXE "10.1"
For VDF11.0 studio, you'll use this
OpenWorkspace.EXE "11.0"
For VDF11.1 studio, you'll use this
OpenWorkspace.EXE "11.1"

....and hope things haven't changed for VDF12 <vbg>
---------------------------------------

//AB/ Project Open Workspace
//AB/ Object prj is a Application_Project
//AB/ Set Size to 150 220
//AB/ Set ProjectName to "Open Workspace"
//AB/ Set ProjectFileName to "OpenWorkspace.src"
//AB/ Set GenerateFileName to "NONAME"

//AB-IgnoreStart
Use DfAllEnt.pkg
// Project Object Structure
// oApplication is a cApplication
// oRegistry is a cRegistry

// Register all objects
Register_Object oApplication
Register_Object oRegistry
//AB-IgnoreEnd

//AB-IgnoreStart
Use cApplication.pkg
Use cCommandLine.pkg
//AB-IgnoreEnd

Object oApplication is a cApplication
//AB/ Set Location to 4 5
//AB-StoreStart
Object oRegistry is a cRegistry
End_Object // oRegistry

Procedure OnCreate
Boolean bOpened
String sRoot sVersion sWorkspace sLine sDesc sPath
Integer iOpened iNumArgs
Handle hoCmdLine

Get phoCommandLine To hoCmdLine
Get CountOfArgs of hoCmdLine To iNumArgs
If (iNumArgs) Move (Argument(hoCmdLine, 1)) to sVersion

Set phRootKey of oRegistry To HKEY_CURRENT_USER
Get OpenKey of oRegistry ("Software\Data Access Worldwide\Visual
Dataflex\"+sVersion+"\Workspaces") To bOpened
If (bOpened) Begin
If (ValueExists(oRegistry, "Current Workspace")) Begin
Get ReadString of oRegistry "Current Workspace" To
sWorkspace
If (sWorkspace) Begin
Move ("["+Trim(sWorkspace)+"]") to sWorkspace
Set phRootKey of oRegistry To HKEY_LOCAL_MACHINE
Get OpenKey of oRegistry ("Software\Data Access
Worldwide\Visual Dataflex\"+sVersion+"\Defaults") To bOpened
If (bOpened) Begin
If (ValueExists(oRegistry, "VDFRootDir")) Begin
Get ReadString of oRegistry "VDFRootDir" To
sRoot
If (sRoot) Begin
Append sRoot "bin\Workspaces.ini"
Direct_Input sRoot
While (Not(SEQEOF))
Readln sLine
If (sLine = sWorkspace) Begin
While ( (Left(lowercase(sLine),
5)<>"path=") and Not(SEQEOF))
Readln sLine
Loop
Move (Right(sLine,
Length(sLine)-5)) to sLine
If (Right(lowercase(sLine), 10)=
"\programs\") Move (Left(sLine, Length(sLine)-10)) to sLine
RunProgram background
('c:\Windows\explorer.exe "' + sLine + '"')
End
Loop
Close_Input
End
End
End
End
End
Send CloseKey of oRegistry
End
End_Procedure
//AB-StoreEnd
End_Object // oApplication
//AB-StoreStart
Abort
//AB-StoreEnd
//AB/ End_Object // prj


--
David Martinko
248-535-7495
Tracker Systems, Inc.
Redeemed Software
Redeemed Hosting
www.trackersys.com
www.redeemedsoftware.com
www.redeemedhosting.com
Proud member of the Northeast DataFlex Consortium: (NEDC)
www.NEDataFlex.com

"David Martinko" <RedeemedSoftware@Hotmail.com> wrote in message
news:4xR0qYRRFHA.2052@dacmail.dataaccess.com...

Vincent Oorsprong
23-Feb-2006, 10:15 AM
David,

Any particular reason why you do not parse the INI file with an object
of the cIniFile class?

--
Regards,
Vincent Oorsprong
Data Access Europe B.V.
http://www.dataaccess.nl

David Martinko
23-Feb-2006, 10:23 AM
Ummm, didn't know it was there.. <g>. Can't know everything... thanks for
the pointer. I'll look into that.

--
David Martinko
248-535-7495
Tracker Systems, Inc.
Redeemed Software
Redeemed Hosting
www.trackersys.com
www.redeemedsoftware.com
www.redeemedhosting.com
Proud member of the Northeast DataFlex Consortium: (NEDC)
www.NEDataFlex.com

"Vincent Oorsprong" <vincent.oorsprong@reply.at.newsgroup.nl> wrote in
message news:a%23MrxvIOGHA.1280@dacmail.dataaccess.com...
David,

Any particular reason why you do not parse the INI file with an object
of the cIniFile class?

--
Regards,
Vincent Oorsprong
Data Access Europe B.V.
http://www.dataaccess.nl