Page 1 of 1

long program

Posted: Tue Jul 13, 2004 3:49 pm
by bonne
I have written a program with a lot of subroutines. As the nomber of sub-routines is increasing I would like use "run program" command, or another method if better.
Question 1: With "runprogram" I cannot return parameters (from called program to calling program). I have tried le command "END xxxx" without success. How return parameter ?
Question 2: Is there a better method to have several program than a long one?
I have Window 98
Thank you, Regards.

Posted: Tue Jul 13, 2004 4:19 pm
by Proteus
Well, you could probably use mailslots to communicate with subprograms, but having one large program looks a little nicer than a big group of small programs.

But if you really want to split it up, using DLLs would be easier then trying to let programs talk to eah other.

Posted: Tue Jul 13, 2004 4:47 pm
by GedB

Posted: Tue Jul 13, 2004 4:50 pm
by GedB
Another note,

When using DLLs don't use the Library commands.

Instead use the dll importer. Have a look in the 'purebasic\Library SDK\DLL Importer' folder.

Posted: Tue Jul 13, 2004 7:24 pm
by GPI
When you want the exit-Code:

Code: Select all

Id=RunProgram(path$+"install.exe","",path$,1) ;Installationsprogramm starten
If Id
  Repeat
    a=getexitcodeprocess_(Id,@ExitCode)
  Until ExitCode<>$103 Or a=0;still_active
EndIf
Should work.

Posted: Tue Jul 13, 2004 11:33 pm
by Moonshine
GedB wrote:Another note,

When using DLLs don't use the Library commands.

Instead use the dll importer. Have a look in the 'purebasic\Library SDK\DLL Importer' folder.
Is it possibe to export a bunch of procedures as a PB DLL, then in turn import that DLL with the Lib SDK DLL importer?

Posted: Wed Jul 14, 2004 12:24 am
by GedB
No problem. Just take a look at the DLL example that comes with PB.

The one problem is that the DLLs will the have to be distributed with your applicaiton.

To keep the benefits of a single DLLs, only binding the functions you need and therefore keeping things small, you want to use purelibraries.

You can create a Purelibrary from Purebasic code using Tailbite:

viewtopic.php?t=9788