----boundary-LibPST-iamunique-564230990_-_-
Content-type: text/plain
Hi Bernhard,
Here is how you can parse the command line and get the parameters as an
array:
PROCEDURE Do*;
VAR r: WinApi.RetCommandLineToArgvW;
p: ARRAY 1024 OF SHORTCHAR;
pw: ARRAY 1024 OF CHAR;
narg: INTEGER;
BEGIN
p := WinApi.GetCommandLine()^$;
pw := p$;
r := WinApi.CommandLineToArgvW(pw, narg);
IF narg = 4 THEN YourOwnProcedureHere(r[1]^$, r[2]^$, r[3]^$); END;
END Do;
You can call for instance this procedure at the end of Config.odc module of
BlackBox:
Dialog.Call("YourModule.Do", "", res)
Then create your exe application while making sure that you include the new
code of Config module. If you can read French, the following guide may help
you with the exe creation:
http://www.latl.unige.ch/taln/tutoriels/exe/GuideCreationApplications.html
Violeta Seretan
============================================================================
====
Assistante-doctorante, LATL - Laboratoire d'Analyse et de Technologie du
Langage
Departement de linguistique, Faculte des Lettres, Universite de Geneve
2, rue de Candolle Tel: +41 22 379 73 32
CH-1211 Geneve 4 Fax: +41 22 379 79 31
-----Message d'origine-----
De : blackbox{([at]})nowhere.xy
Bernhard.Sowka{([at]})nowhere.xy
Envoye : lundi, 20. juin 2005 13:09
A : BlackBox Mailing List
Objet : [BlackBox] - command line parameters
I am new with BlackBox.
I am going to develop a *.exe file and I want to control this programm with
command line parameters.
Does anyone know how can I access to the command line parameters?
Cheers
Bernhard
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-564230990_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c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