long program

Just starting out? Need help? Post your questions and find answers here.
bonne
New User
New User
Posts: 3
Joined: Mon Dec 01, 2003 11:50 pm

long program

Post 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.
Proteus
Enthusiast
Enthusiast
Posts: 113
Joined: Wed Sep 17, 2003 8:04 pm
Location: The Netherlands

Post 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.
P4 2.4GHz, 256 MB, WinXP Pro, onboard video&audio.
The Programmer's Drinking Song:
"99 little bugs in the code,
99 little bugs.
Fix one bug, recompile
100 little bugs in the code."
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post 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.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post 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?
Mark my words, when you least expect it, your uppance will come...
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post 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
Post Reply