Author Topic: StartPath  (Read 1943 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
StartPath
« on: February 07, 2013, 10:40:46 AM »
Charles...
Do you can explain me what is proper way to use file startpath in Oxygen Basic.
I mean something like this ,for example i try to use in Asciedit this:

Code: [Select]
ShellExecute(0,"open", "/gxo2.exe","-c" + fName,"" , 5)and work for file which is in same folder where is gxo2.exe...
but compiler don't respond on file somewhere else ?
In OxyEdit work ...
What might be problem?

Charles Pegge

  • Guest
Re: StartPath
« Reply #1 on: February 07, 2013, 11:40:54 AM »
Hi Aurel,

Your source file is in the current directory, I assume.

I don't use ShellExecute but I think you need to make sure that the full pathname to gxo2 is specified, and also the full pathname to the source code.

To capture the pathname for gxo2 at IDE startup, I use GetCurrentDirectory:

   static char    buf[256]
    ...
    GetCurrentDirectory 256, buf
    o2dir=buf+"\"


Charles

Aurel

  • Guest
Re: StartPath
« Reply #2 on: February 07, 2013, 01:59:01 PM »
Yes Charles...you right...
uff ...how i can forget GetCurrentDirectory() ::)

Aurel

  • Guest
Re: StartPath
« Reply #3 on: February 08, 2013, 01:29:16 PM »
Yes it work Ok.

Next code is added in global scope...
string gxName="\gxo2.exe"
char cdPath[256]
GetCurrentDir (256,cdPath)
cdPath=cdPath + gxName
print cdPath




So ,when you put editor exe in oxygen basic main folder( root)..
File opened from anywhere on your computer can be compiled.
« Last Edit: February 10, 2013, 12:08:34 AM by Aurel »