OpenersNotesSection(Spacer1)Details

(NonWLLink[WSInitialize(), paclet:ref/c/WSInitialize]) must be called before WSOpenString.

WSOpenString() takes a single string instead of the argv array used by (NonWLLink[WSOpenArgcArgv(), paclet:ref/c/WSOpenArgcArgv]).

Arguments in the string are separated by spaces.

On some computer systems, giving NULL in place of the string pointer will cause arguments to be requested interactively, typically through a dialog box.

WSOpenString() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

int main()
{
	WSENV env;
	WSLINK link;
	int error;

	env = WSInitialize((WSEnvironmentParameter)0);
	if(env == (WSENV)0)
		{ /* unable to initialize WSTP environment */ }

	link = WSOpenString(env, "/usr/local/bin/math -mathlink", &error);
	if(link == (WSLINK)0 || error != WSEOK)
		{ /* unable to create link to the Kernel */ }

	/* ... */

	WSClose(link);
	WSDeinitialize(env);

	return 0;
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSActivate(), paclet:ref/c/WSActivate])  ▪  (NonWLLink[WSOpenArgcArgv(), paclet:ref/c/WSOpenArgcArgv])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Running the Wolfram System from within an External Program, paclet:tutorial/RunningTheWolframSystemFromWithinAnExternalProgram])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[C/C++ Language Interface, paclet:guide/CLanguageInterface])}, {▪(RefLinkPlain[WSTP API, paclet:guide/WSTPAPI])}, {▪(RefLinkPlain[WSTP C Language Functions, paclet:guide/WSTPCLanguageFunctions])}, {▪(RefLinkPlain[WSTP Connection Management, paclet:guide/WSTPConnectionManagement])}})}})