Metropoli BBS
VIEWER: spawn.c MODE: TEXT (ASCII)
//this file is a mess, and will be until I can get this working under Windoze

#include <qlib.h>
#include <process.h>
#include <mem.h>
#include <stdio.h>
#include <conio.h>
#include <alloc.h>

void main(void) {
  volatile dword a;
  byte *newenviro[]={"env1=Cool","env2=Works!"};
  printf("Total free=%d\n",coreleft());
  printf("Spawn tests\n");

  if (spawnle(P_WAIT,"enviro.exe","This","works!",NULL,newenviro)==ERROR) {
    printf("Spawn(\"enviro\") failed!\n");
  }

  printf("slap a key...\n");getch();

  if (spawnlp(P_WAIT,"args.exe","This","works!",NULL)==ERROR) {
    printf("Spawn(\"args\") failed!\n");
  }

  printf("slap a key...\n");getch();

  if (spawnlp(P_WAIT,"spawnbat.bAt","This","works","too",NULL)==ERROR) {
    printf("Spawn(\"spawnbat.bat\") failed!\n");
  }

  printf("slap a key...\n");getch();

}

/*/
  asm {
    xor ebx,ebx
    mov ah,51h
    int 21h
    mov a,ebx
    mov es,seldata
    mov ds,seldata
  }
  printf("ebx=%x\n",a);
/*/

[ RETURN TO DIRECTORY ]