User Tools

Site Tools


gemus_script_reference:comparison_fields

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

gemus_script_reference:comparison_fields [2020/05/12 11:24] (current)
Jimbo created
Line 1: Line 1:
 +====== GEMUS Comparison Fields ======
  
 +===== Comparison Fields =====
 +
 +^ Field Name ^ Operators ^ Description ^
 +| GameType | [[#​CONTAINS]],​ [[#​EXCLUDES]] | This field signifies the type of game being run by the script. It directly correlates to the game's filename extension (without the preceding "​."​ character). Possible values for this field might be D64, TAP etc.. Example: <​code>​If GameType CONTAINS(D64||TAP)</​code>​ |
 +| Control | =, != | This field signifies the primary control method of the game being run by the script. This field will contain one of the following values: JoyPort1, JoyPort2, Keyboard, PaddlePort1,​ PaddlePort2,​ Mouse, LightPen, KoalaPad or LightGun. Example: <​code>​ElseIf Control = JoyPort2</​code>​ |
 +| NumPlayers | =, !=, <, > | This field signifies the number of players that the game being run by the script supports. This will typically be a number larger than 0. Example: <​code>​If NumPlayers > 1</​code>​ |
 +| PalNTSC | =, != | This field signifies the whether the game being run by the script is Pal or NTSC compliant. This field will contain one of the following values: PAL, NTSC or BOTH. Example: <​code>​ElseIf PalNTSC = NTSC</​code>​ |
 +| TrueDriveEmu | = | This field signifies the whether the game being run by the script has its True Drive Emulation setting enabled. This field will contain either YES or NO. Example: <​code>​ElseIf TrueDriveEmu = YES</​code>​ |
 +| GameComment | [[#​CONTAINS]],​ [[#​EXCLUDES]] | This field signifies the "Game Comment"​ database field of the game being run by the script. Example: <​code>​If GameComment CONTAINS(*password is:​*)</​code>​ |
 +| VersionComment | [[#​CONTAINS]],​ [[#​EXCLUDES]] | This field signifies the "​Version Comment"​ database field of the game being run by the script. Example: <​code>​ElseIf VersionComment CONTAINS(*load manually*)</​code>​ |
 +| ImageName | [[#​CONTAINS]],​ [[#​EXCLUDES]] | This field contains the same value as the [[.:​environment_variables|%imagename%]] script environment variable. Example: <​code>​ElseIf ImageName CONTAINS(*)</​code>​ (not: If %imagename% CONTAINS(*)). Note: you cannot use the %imagename% variable as a comparison field name, nor can you use the ImageName field name as an environment variable. Be careful not to confuse the two - field names are for comparisons only, whilst environment variables are for replacing text in function parameters only. |
 +| NumFiles | =, !=, <, > | This field signifies the number of game files selected for the game being run by the script. It contains the same value as the [[.:​environment_variables|%numfiles%]] script environment variable. Note: you cannot use the %numfiles% variable as a comparison field name, nor can you use the NumFiles field name as an environment variable. Be careful not to confuse the two - field names are for comparisons only, whilst environment variables are for replacing text in function parameters only. Example: <​code>​If NumFiles = 2</​code>​ (not: If %numfiles% = 2) |
 +| QUESTION(text) | = | This field is really a comparison function. It will display a message window asking the question text to the user, who must respond by either clicking a YES or NO button to answer the question. Example: <​code>​If QUESTION(Do you want to run in NTSC mode?) = YES</​code>​ |
 +| Key_keyname | [[#​CONTAINS]],​ [[#​EXCLUDES]] | The //​Key_keyname//​ fields give you lots of flexibility in GEMUS. By pressing F2 (or selecting the '​GEMUS'​ item from GameBase'​s '​Edit'​ menu) you can optionally put in key=value pairs for each game. These pairs can really be anything you like, for instance //​memory=512//​ or //​fullscreen=yes//​. By creating these pairs, you can test for virtually any game-specific setting or option within a GEMUS comparison statement. To test the field, just put the prefix "​Key_"​ before the name of the key you want to test. Example: <​code>​If Key_memory CONTAINS(512)</​code>​ See also the [[.:​environment_variables|%keyname_value%]] environment variable. |
 +| %...% | [[#​CONTAINS]],​ [[#​EXCLUDES]] | This field %...% corresponds to any [[.:​environment_variables|script environment variable]]. For example, if you want to test a game's filename has certain text in it (e.g. a TOSEC filename) you could use the environment variable //​%gamefile%//​ with the [[#​CONTAINS]] function. Example: <​code>​If %gamefile% CONTAINS(*128k*)</​code>​ |
 +\\ 
 +
 +===== Comparison Operators =====
 +
 +^ Operator ^ Usage ^ Description ^
 +| **=** | [If%%|%%ElseIf] //​FieldName//​ = //Value// | Returns True if //​Fieldname//​ is equal to //Value// |
 +| **!=** | [If%%|%%ElseIf] //​FieldName//​ != //Value// | Returns True if //​Fieldname//​ is not equal to //Value// |
 +| **<** | [If%%|%%ElseIf] //​FieldName//​ < //Value// | Returns True if //​Fieldname//​ is numerically less than //Value// |
 +| **>** | [If%%|%%ElseIf] //​FieldName//​ > //Value// | Returns True if //​Fieldname//​ is numerically more than //Value// |
 +| **CONTAINS** | [If%%|%%ElseIf] //​FieldName//​ CONTAINS([*]//​value//​[*][%%||%%[*]//​value//​[*]...]) | The CONTAINS operator returns True if a textual match has been found in **at least one** of the supplied //value// arguments. Multiple values can be supplied by separating them with the %%||%% delimiter. The criteria for matching the values is as follows: -\\ \\ //​value=*text*//​ -> Returns True if //value// is found anywhere in //​FieldName//​\\ //​value=text*//​ -> Returns True if //value// matches the beginning characters in //​FieldName//​\\ //​value=*text//​ -> Returns True if //value// matches the ending characters in //​FieldName//​\\ //​value=text//​ -> Returns True if //value// exactly matches //​FieldName//​\\ //value=*// -> Returns True if //value// is non-empty |
 +| **EXCLUDES** | [If%%|%%ElseIf] //​FieldName//​ EXCLUDES([*]//​value//​[*][%%||%%[*]//​value//​[*]...]) | The EXCLUDES operator returns True if a textual match has NOT been found in **all** of the supplied //value// arguments. Multiple values can be supplied by separating them with the %%||%% delimiter. This is basically the opposite of the CONTAINS operator. |
gemus_script_reference/comparison_fields.txt · Last modified: 2020/05/12 11:24 by Jimbo