mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
working on documentation examples
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/branches/ErrorHandling@6101 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
f67cc37b15
commit
f93d48d395
31
doc/examples/F90GetSelectedOutputStringLine.f90
Normal file
31
doc/examples/F90GetSelectedOutputStringLine.f90
Normal file
@ -0,0 +1,31 @@
|
||||
PROGRAM example
|
||||
INCLUDE "IPhreeqc.f90.inc"
|
||||
INTEGER(KIND=4) :: id
|
||||
INTEGER(KIND=4) :: i
|
||||
CHARACTER(LEN=400):: line
|
||||
|
||||
id = CreateIPhreeqc()
|
||||
IF (id.LT.0) THEN
|
||||
STOP
|
||||
END IF
|
||||
|
||||
IF (LoadDatabase(id, "phreeqc.dat").NE.0) THEN
|
||||
CALL OutputErrorString(id)
|
||||
STOP
|
||||
END IF
|
||||
|
||||
IF (RunFile(id, "ex2").NE.0) THEN
|
||||
CALL OutputErrorString(id)
|
||||
STOP
|
||||
END IF
|
||||
|
||||
WRITE(*,*) "selected-output:"
|
||||
DO i=1,GetSelectedOutputStringLineCount(id)
|
||||
CALL GetSelectedOutputStringLine(id, i, line)
|
||||
WRITE(*,*) TRIM(line)
|
||||
END DO
|
||||
|
||||
IF (DestroyIPhreeqc(id).NE.IPQ_OK) THEN
|
||||
STOP
|
||||
END IF
|
||||
END PROGRAM example
|
||||
32
doc/examples/GetSelectedOutputString.c
Normal file
32
doc/examples/GetSelectedOutputString.c
Normal file
@ -0,0 +1,32 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <IPhreeqc.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int id;
|
||||
|
||||
id = CreateIPhreeqc();
|
||||
if (id < 0) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (LoadDatabase(id, "phreeqc.dat") != 0) {
|
||||
OutputErrorString(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (RunFile(id, "ex2") != 0) {
|
||||
OutputErrorString(id);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
printf("selected-output:\n");
|
||||
printf("%s\n", GetSelectedOutputString(id));
|
||||
|
||||
if (DestroyIPhreeqc(id)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user