'encoding UTF-8 Do not remove or change this line! '************************************************************** ' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information ' regarding copyright ownership. The ASF licenses this file ' to you under the Apache License, Version 2.0 (the ' "License"); you may not use this file except in compliance ' with the License. You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, ' software distributed under the License is distributed on an ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. ' '************************************************************** '* '* short description : tools for evaluation of key=value datalists '* '******************************************************************************* ' ** ' #1 hGetDataPairAsString ' retrieve key=value from a list ' #1 hGetValueForPairAsString ' retrieve value from a key=value as string ' #1 hGetValueForPairAsLong ' retrieve value from a key=value as long integer ' #1 hGetValueForKeyAsInt ' retrieve value for a specified key as integer ' #1 hGetValueForKeyAsLong ' retrieve value for a specified key as long integer ' #1 hGetKeyForPairAsString ' retrieve key from key=value as string ' #1 hGetKeyForValueAsString ' retrieve key for a specified value as string ' #1 hGetKeyForValueAsInt ' retrieve key for a specified value as int ' #1 hGetIndexForKeyAsInt ' retrieve the index for a key in a list ' #1 KeyCompare ' compare two keys ' ** '\****************************************************************************** ' Some variables explained: ' ' cComp is the KEY belonging to the VALUE above for reverse test ' ' NOTE: Other related functions can be found in global/tools/inc/t_filters.inc '******************************************************************************* function hGetDataPairAsString( sKey as string, sVal as long ) as string '///

Concatenate two strings and insert an = sign

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Input: '///
    '///+
  1. KEY (string)
  2. '/// '///+
  3. VALUE (string)
  4. '/// '///
'///Returns: '///
    '///+
  1. KEY=VALUE pair (string)
  2. '///
'///Description: '/// end function '******************************************************************************* function hGetValueForPairAsString( cLine as string ) as string '///

Retrieve value from a key=value string

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Input: '///
    '///+
  1. KEY=VALUE pair (string)
  2. '///
'///Returns: '///
    '///+
  1. VALUE (string)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hGetValueForPairAsLong( cLine as string ) as long '///

Retrieve the value from a key=value pair as long

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Input: '///
    '///+
  1. KEY=VALUE pair (string)
  2. '///
'///Returns: '///
    '///+
  1. VALUE (long)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hGetValueForKeyAsInt( lsList() as string, sKey as string ) as integer '///

Retrieve the value of a key=value pair as integer

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Prerequisite: Array compatible to listfuncs, known, valid key

'///Input: '///
    '///+
  1. List of KEY=VALUE pairs (string)
  2. '/// '///+
  3. Key to be searched for within the list (string)
  4. '/// '///
'///Returns: '///
    '///+
  1. VALUE (integer)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hGetValueForKeyAsLong( lsList() as string, sKey as string ) as long '///

Retrieve the value of a key=value pair as integer

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Prerequisite: Array compatible to listfuncs, known, valid key

'///Input: '///
    '///+
  1. List of KEY=VALUE pairs (string)
  2. '/// '///+
  3. Key to be searched for within the list (string)
  4. '/// '///
'///Returns: '///
    '///+
  1. VALUE (long integer)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hGetKeyForPairAsString( cLine as string ) as string '///

Retrieve the KEY from a key=value pair

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Input: '///
    '///+
  1. KEY=VALUE pair (string)
  2. '///
'///Returns: '///
    '///+
  1. KEY (string)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function hGetKeyForValueAsString( lsList() as string, sVal as string ) as string '///

Retrieve the KEY for a known VALUE from a key=value pair

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Prerequisite: List compatible to listfuncs, known VALUE for pair

'///Input: '///
    '///+
  1. List of KEY=VALUE pairs (string)
  2. '/// '///+
  3. VALUE (string)
  4. '/// '///
'///Returns: '///
    '///+
  1. KEY (string)
  2. '///
'///Description: '/// end function '******************************************************************************* function hGetKeyForValueAsInt( lsList() as string, sVal as string ) as integer '///

Retrieve the KEY for a known VALUE from a key=value pair

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Prerequisite: List compatible to listfuncs, known VALUE for pair

'///Input: '///
    '///+
  1. List of KEY=VALUE pairs (string)
  2. '///+
  3. VALUE (string)
  4. '/// '///
'///Returns: '///
    '///+
  1. KEY (integer)
  2. '///
'///Description: '/// end function '******************************************************************************* function hGetIndexForKeyAsInt( lsList() as string, sKey as string ) as integer '///

Search a list of key=value pairs for a key and return its index

'///About "KEY"-functions:
'///These functions are used whenever '///+ data is to be processed that is stored in a key=value format.
'///+ They handle a single string or a list of strings '///+ to e.g. isolate a key, a value or to just retrieve the pair.


'///Prerequisite: List compatible to listfuncs, known VALUE for pair

'///Input: '///
    '///+
  1. List of KEY=VALUE pairs (string)
  2. '///+
  3. KEY to search for (string)
  4. '///
'///Returns: '///
    '///+
  1. Index of the KEY in the list (integer)
  2. '/// '///
'///Description: '/// end function '******************************************************************************* function keycompare( found as string, expected as string, sKey as string, optional cBugID as string) as boolean '///

Function to compare two keys with each other

'///Deprecated, do not use if ( isMissing( cBugID ) ) then cBugID = "" endif if ( lcase(found) = lcase(expected) ) then printlog( " * '" & sKey & "': ok" ) keycompare = true else warnlog( "#" + cBugID + "# Control has incorrect value: '" & sKey & "'") printlog( " > Found...: '" & found & "'" ) printlog( " > Expected: '" & expected & "'" ) keycompare = false endif end function