[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Basic arrays in PhreeqcI


I eventually tracked down a 'problem' to code like this:


10 DIM c(5)
20 c(1) = 2
30 c(2) = 3
40 c(3) = 0
50 PRINT"Before: c1-c3="c(1)c(2)c(3)
60 c(3) = c(1)*c(2)
70 PRINT"After: c1-c3="c(1)c(2)c(3)
80 c(1) = 2
90 c(2) = 3
100 c(3) = 0
110 d = c(1)*c(2)
120 c(3) = d
130 PRINT"Again: c1-c3="c(1)c(2)c(3)



Before: c1-c3=            2            3            0 
After: c1-c3=            2            6            0 
Again: c1-c3=            2            3            6 


In the first case, the result is incorrectly assigned to c(2) not
c(3). It's OK when a temporary variable is used as in the second case.
I plonked the code into another Basic interpreter here and it gave the
right answer both times.

I am using PhreeqcI

Incidentally, where is the best free documentation for the Basic

Also the SURF(,) keyword produces a syntax error when Renumbering a
USER_PUNCH section.

I think you and Scott have done a truly magnificent job with PHREEQC
and now PHREEQCI. Thanks. I am a fully paid-up member of the
Parkhurst-Charlton-Appelo fan club.

I hope I wasn't too abrupt in my recent query re Kirk's revised As
thermo data. I have tried to do my best to put the new data into
PHREEQC (and GWB) format but I'm aware that it is easy to get things
wrong especially as I had to rework several of the equations and the
consistency issue rattles down through the data. Basically I trust you
to do it a lot more than I trust myself! The new data significantly
change the speciation in reduced systems. Obviously As is a key
element of interest at the moment and it would be nice to use the best
data as soon as possible.

Best regards


Project Home Page
Complete Water Resources Division Software
USGS Home Page
Water Resources Division Home Page
NRP Home Page
Help Page
USGS Privacy Statement       

Please note that some U.S. Geological Survey (USGS) information accessed through this page may be preliminary in nature and presented prior to final review and approval by the Director of the USGS. This information is provided with the understanding that it is not guaranteed to be correct or complete and conclusions drawn from such information are the sole responsibility of the user.

Any use of trade, product, or firm names in this publication is for descriptive purposes only and does not imply endorsement by the U.S. Government. 

The URL of this page is: https://wwwbrr.cr.usgs.gov/projects/GWC_coupled/phreeqc/mail/msg00612.html
Last modified: $Date: 2005-09-13 21:04:21 -0600 (Tue, 13 Sep 2005) $
Visitor number 2670 since Jan 22, 1998.