structure

Gets a SMILES depiction from the DayCGI.

Syntax

list  structure(id,SMILES,image_width,image_height,color,[label])
char  chemical id, SMILES, label
int   image-width in pixels, image-height in pixels, color

Description

The DayCGI interprets a SMILES and returns the structure as a .GIF image. The default string length for SMILES is <=2000 bytes

The image image_width and image-height are measured in pixels. Daylight suggests the following sizes:

DayCGI standard image sizes, pixels

Shape

Width

Height

Note

WIDE

400

200

Default, fits across most browsers

SMALL

96

64

Used for icons.

MEDIUM

240

200

Fits two-across in most browsers.

LARGE

640

480

Fits most monitors.

The DayCGI offers the following color options:

Code

Color

1

black on white

2

black on paper

10

white on black

20

color on black

21

color on white

22

color on paper

The label, typically a structure identification number or a chemical name, is printed above the structure.

If the id or SMILES parameters are null, structure() displays an error message and aborts. G.CACHE_LIST is searched for the structure ID and, if found, the structure is displayed from memory rather than the DayCGI

The ASCII SMILES, image width, image height and color are catenated and converted to hexadecimal code. This code is submitted to the DayCGI which returns a depiction of the SMILES in a file called id.gif. Finally, the id.gif is registered in G.cache_list for future reference.

Example

To refresh the structural image each time the SMILES changes, place the following trigger in the SMILES field and turn on the field attribute to "calculate."

 {
 /* window_name.structure is defined as a graphic list. */

 window_name.structure = structure  
  (p.id^^current,p.smiles,197,115,21,p.id);
 list_view2(window_name.structure,-1,-1,-1,0);
 }


Updated 19 May 1999. Copyright DataAspects Corp. 1998-1999