• No results found

Configuration queries

In document PSProfDeveloperManualEnglish (Page 95-99)

#(= fieldtype ( "<FieldName>" ) ), #(= fieldtype ( <FieldNumber> ) )

The field type is returned.

Return value

C: Field is a character field D: Field is a date field N: Field is a numerical field

<empty>: FieldName or FieldNumber does not exist, or type can not be determined, or is not supported.

#( FieldDesc <FieldName> )

A descriptive text for the given database field name is substituted.

Procedure

The EntityType object of the current object is determined. The given field name for this EntityType object is sought in the configuration in the sub-component GUIFields. The value of the attribute Caption (or Descrip-tion if it is empty) is substituted from this field name. If this fails, the field name itself is returned. If the field name in the current context is unknown, an empty string is substituted. An error message is not issued.

At least one valid Folder object is required for the evaluation. In this case, the EntityType object of the Folder object is used (it is normally assumed that a valid record buffer containing an EntityType object exists).

The character string is substituted according to the handle FieldDesc.

Configuration queries

This query must always be placed in parentheses.

#( HCLS <Registry-Key> <ValueName> [:<Formatting>] )

Reads out information from the registry in the subtree HKEY_CLASSES_ROOT. The <RegistryKey> is en-tered as a directory using backslashes as separators.

Example:

Reading out the path for WinZip:

#(HCLS "Winzip\shell\open\command" "" :v1 )

An empty string is returned if WinZip is not installed on the workstation. The first argument is resolved by quotation marks "..." using the format :v1.

#( HLOM <Registry-Key> <ValueName> [:<Formatting>] )

Reads out information from the registry in the subtree HKEY_LOCAL_MACHINE.

Example ' see #(HCLS ...).

#( HKCU <Registry-Key> <ValueName> [:<Formatting>] )

Reads out information from the registry in the subtree HKEY_CURRENT_USER.

Example ' see #(HCLS ...).

#( Appl: <Attribute> ), #( Appl <Attribute> )

This function returns the value of the Attribute for the current Application object. It is only practical if a func-tion has been called for the Applicafunc-tion object (this is why the developer is not given a value when attempting to read out such a value using ___Shell(read() ..., for example).

As soon as a function has been called for the Application object (e.g. Open), and the application has been iden-tified by CheckFuncSupported, the Attributes of this Application object are also determined.

#( DBView )

The name of the database view (SQLView) of the Folder object is substituted for the current context.

An empty string is returned in the event of an error.

Configuration queries 82

#( DBNAME )

Name of the current Folder object.

#( DBQNAME )

Name of the database parameter file with the directory and file extension.

#( DBQPATH )

Directory of the database parameter file.

#( DBQFINAME )

Name of the database parameter file without the directory and file extension.

#( DBQEXT )

File extension of the database parameter file.

#( DBSIZE )

Number of records in the database table

#( DBINI: <Attribute> ), #( DBINI <Attribute> )

The value of the given parameter is determined in the folder-related section of the file COMPASS.INI. The parameter can also be stated using environment variables. If the value cannot be determined, the error is re-corded in the error log errlog.err.

#( DBI: <Attribute> ), #( DBI <Attribute> )

Corresponds to the variables #(DBINI: <Attribute>). However, errors are not recorded in the error log. This query must always be placed in parentheses!

#( CFGAttribute: <Attribute> [:<Formatting>] ), #( CFGAttribute <Attribute> … )

This function returns the value of the given Attribute from the configuration. <Attribute> can be an expressi-on. Recursive definitions are not allowed!

The object model is searched for the relevant record in the following sequence:

• Folder object: The attribute is sought in the Folder object of the current context taking FolderStructure into consideration. The search is stopped when the attribute has been found.

• DocumentType object: The search is only run in the DocumentType object if the current context knows a record buffer (Object), and this contains the field FILE_TYPE. The <Attribute> is then sought taking Do-cumentTypeStructure into consideration. This search is stopped when the attribute has been found.

• EntityType object: Finally, the attribute is sought taking EntityTypeStructure into consideration.

The found return value is always substituted and then returned. If the attribute could not be found, an empty string is returned and the error is recorded in the file errlog.err.

Version 5.4.0

Configuration queries 83

#(CFGAttributeMap: <AttributenamePrefix>), #(CFGAttributeMap <Attributena-mePrefix>)

This function collates all the attributes in a newly created map (see ___Map and #(Map )), whose name begins with <AttributeNamePrefix>, and returns the name of the new map. The map contains all the attributes that have been found. The attribute name is the key and the attribute value is the value from the configuration.

<AttributeNamePrefix> can be a Productstream Professional expression, e.g. #(Symbol:ActivatedBy). Recur-sive definitions are not allowed!

The object model is searched for the suitable records in the following sequence:

• Folder object: All attributes beginning with AttributeNamePrefix are added to the map. The FolderStruc-ture is taken into consideration.

• DocumentType object: The search is only run in the DocumentType object if the current context knows a record buffer (Object), and this contains the field FILE_TYPE. The attributes are then added taking the DocumentTypeStructure into consideration. Attributes already present in the map are ignored. If the field FILE_TYPE for the current context is empty, the attributes of the document type * are used.

• EntityType object: Finally, the attributes are filled into the map taking the EntityTypeStructure into consi-deration. Attributes already present in the map are ignored.

If an attribute matching the parameter cannot be found, an empty map is created and its name is returned.

Iteration is possible with ___Map(enum MapName function) using the attributes.

The created map then has to be deleted again (___Map(destroy <MapName>)).

Version 5.6.0 Example

Generic function for iteration using attributes:

/* arg1: Attribute name begins with

arg2: public function name for the iteration */

public ProcessConfigAttributes, AIM_ ProcessConfigAttributes procedure AIM_ ProcessConfigAttributes

___Environment (cfgMapName=#(CFGAttributeMap:$(arg:v1)));

___Map (enum $cfgMapName $(arg :v2));

___Map (destroy $cfgMapName);

endproc

#( DTY: <Attribute> ), #( DTY <Attribute> )

Queries an attribute <Attribute> from the definition DocumentType object. The value of this attribute relates to the DocumentType object of the current object.

Here, the attribute is sought from the current DocumentType object. Attributes in objects which have not been specifically defined as DocumentType objects are also found.

Example

Query for an AutoCAD drawing:

#(DTY:Template0)

Result = 2d-drawing.dwg

Query for an engineering document:

#(DTY:Icon)

Result = icon0006.ico

#( DTYID: <DocumentTypeObject> : <Attribute> ),

#( DTYID <DocumentTypeObject> <Attribute> )

Queries a parameter from the definition of the DocumentType objects. The value of this attribute relates to the given DocumentType object.

#( ETYPE [<Attribute>] )

Queries an attribute from the definition of the EntityType objects. The value of this attribute relates to the given EntityType object.

If <Attribute> is not defined, the EntityType of the current element is returned.

Configuration queries 84

#( GUIViewExist <GUIView-Object> )

This condition checks whether the given GUIView object actually exists.

Return value

TRUE: if a GUIView object with the given name exists FALSE: if a GUIView object with the given name does not exist

#( GUIViewParent <Expression> )

Substitutes the <Expression> given using the identifier GUIViewParent. The record with the focus of the pa-rent GUIView object of the curpa-rent context is used as the context.

Return value

Example

Return value for the Folder object, GUIView object and EntityType object of the parent element:

#(GUIViewParent #(DBNAME) - #(MSKNAME) - #(ETYPE) )

#( GUIViewRoot <Expression> )

As #(GUIViewParent ...), but here the highest ranking GUIView object is used as the current context.

In a standard display window, this function finds the active AIM.FOLDER element of the folder structure.

In a New record dialog window, this context contains the object belonging to the record buffer.

In the advanced search, this is the AIM.FOLDER element, which is integrated into the folder structure.

Version 5.2.3.1

#( INI: <Section> : <Attribute> ), #( INI <Section> <Attribute> )

This function searches for the <Attribute> in the configuration and in the file compas.ini from the component

<Section>. The name of the component can be any object or element.

Example

Returning the BaseFolder object of an engineering document:

#(INI:AIM.DOC.ENG:BaseFolder)

#( I: <Section> : <Attribute> ), #( I <Section> <Attribute> )

Synonymous to #( INI:...) from COMPASS.INI. Here, an error is not recorded in the file errlog.err if the at-tribute can not be found.

#( DBINI: <Attribute> ), #( DBINI <Attribute> )

Starting at the current folder object, this function searches for <Attribute> and returns its value.

#( DBI: <Attribute> ), #( DBI <Attribute> )

Synonymous to #( INI:...) from COMPASS.INI. Here, an error is not recorded in the file errlog.err if the at-tribute cannot be found.

#( MSKNAME )

Returns the GUIView object of the current context.

"" If a current dialog is not contained in the context

If the current dialog does not possess a parent GUIView object If the <Expression> returns an empty result

If the parent GUIView object does not contain an object with focus

In document PSProfDeveloperManualEnglish (Page 95-99)