Page 1 of 1

Most used/useful ChemStation Commands

Posted: Thu Mar 08, 2012 11:26 pm
by cawarhur
I've toyed with the idea of using the ChemStation command line before, but I don't know how I would implement them...likely because I don't have much to benefit from them at the moment, but I might use them in the distant future.

My question to the ChromForum community is: what commands do you use most and why? what are the macros usually designed to handle with chemstation?

Re: Most used/useful ChemStation Commands

Posted: Mon Mar 19, 2012 9:51 pm
by apika
The command line itself is mostly only useful for implementing macros, since most of what you would do from the command line is about as fast to start from the GUI. That said, I use quite a lot of the command line stuff for testing and sometimes just because it's fun.

As an example, the most common commands I use are:
macro "macrofilename.mac",go
which loads and executes a macro, and
macro "macrofilename.mac"
which just loads it without executing.

Here are the most useful commands I've found for actually programming Chemstation to do things:

print
Prints the product of the next command or content of quotation marks to the command line. (note: if you want it to print to a file you need "print using", if you need to print to a printer it's strprint. More on this is in chemstation help files.)
len(stringvariable$)
Calculates the length of the variable within the parenthesis.
len("string")
Calculates the length of the text string within the quotation marks.
eqstr("string1",stringvar1$)
Compares the equivalency of two strings (or in this case, a string and a string variable.)
QT x,y,"A"
Generates a report. If x=1 it recalculates, 0 does not recalculate. If y=1 it prints, 0 is to screen. If A=S, it's a summary report. F is a detailed report.
printtextfile "C:\filepath\file.txt"
Just what it says :)
CCCHK x
Continuing calibration check. If x=1 it prints, 0 is to screen.
copy "C:\oldfilepath1.txt","C:\newfilepath2.txt",DONTASK
Copies the first file to the location/name in the second file without asking whether or not to replace any files in the new folder.
tunecheck x,"TYPE",y
Checks the tune. If x=1, it autofinds, 0 evaluates. The type should be "BFB" for bfb and "DFTPP for dftpp tunes. If y=1, it prints, if 0 it's to screen.
calrpt x
Generates a response factor report. x=1 is to printer, 0 is to screen.

Usually macros are for automating repetitive tasks, like generating printed reports or creating a standard calibration information file. I wrote one that automatically prints out quadratic and linear calibration equation graphs, for example.