PDA

View Full Version : The new programming language, SB6...



NewsArchive
09-12-2008, 02:24 AM
Hi Friedrich!

When I saw what I could do with the KillApp.Sb6 script, I decided to make a
CheckApp.sb6 script, that checks for a program about its running. If not, it
runs it.
Its pretty close, but there is a couple of 'Gotcha's left:

I use RunCommandLine to start the program.
How to set the path for the started program?

I read an ini file to get the name of the program to run.
In the example, I have it with a hard coded adress.
What i really need is [Current path]\cdrun.ini instead
I really dare not to ask 'Possible', so I use instead 'How to'

Edvard Korsbæk

NewsArchive
09-12-2008, 02:24 AM
Hi Edvard,

> When I saw what I could do with the KillApp.Sb6 script, I decided to make
> a CheckApp.sb6 script, that checks for a program about its running. If
> not, it runs it.

Cool :)

> Its pretty close, but there is a couple of 'Gotcha's left:
>
> I use RunCommandLine to start the program.
> How to set the path for the started program?

Do you know the path of that program before you start CheckApp.exe? In
other words, would you like to pass the application name (used to check if
it is running) and the fully qualified filename (used to start it if it is
not active) via the command line?

> I read an ini file to get the name of the program to run.
> In the example, I have it with a hard coded adress.
> What i really need is [Current path]\cdrun.ini instead
> I really dare not to ask 'Possible', so I use instead 'How to'

Just use Get Systemn Information (Installer Path Name).

For example:

Set Variable %CURRENT_PATH% to FUNCTION:Get System Information(Installer
Path Name)

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-12-2008, 02:25 AM
Do you know the path of that program before you start CheckApp.exe? In
other words, would you like to pass the application name (used to check if
it is running) and the fully qualified filename (used to start it if it is
not active) via the command line?
----
I use ValUtilities quite a lot, and the lines below uses the functions from
there.

The program i should start uses its own folder as path

In Clarion I do it like this:
Localpath = Longpath()
SETPATH(VuExtractPath('called program')
VuRun(Called Program,1,0)
Setpath(LocalPath)

In SB6, I use CommandLine for´VuRun(Called Program,1,0), and it does what it
is supposed to do.
What i miss is the SETPATH() statement

Edvard

NewsArchive
09-12-2008, 02:26 AM
The INI part does exactly what it is supposed to do - Thx.

Edvard Korsbæk

NewsArchive
09-12-2008, 02:27 AM
> In SB6, I use CommandLine for´VuRun(Called Program,1,0), and it does what
> it is supposed to do.
> What i miss is the SETPATH() statement

Well, no problem <g>. See attached demo project and source code. The
application displays the current directory, sets the current directory to
c:\windows and displays the (new) current directory again.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-12-2008, 02:28 AM
Does this help?
Yes

As Usual - Thanks Friedrich

Edvard

NewsArchive
09-12-2008, 02:28 AM
> Does this help?
> Yes
>
> As Usual - Thanks Friedrich

You are very welcome. I think this function is very useful, so it will be
built-in script function in SB7.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner