Free Hero Mesh

Artifact [45efdeb1c6]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Artifact 45efdeb1c66cc18886f75ac373aa33dec345c997:

Wiki page [SQL functions] by zzo38 on 2018-06-10 15:52:56.
D 2018-06-10T15:52:56.194
L SQL\sfunctions
P 6923f03d05639f30bba0948acf1d56f4d94651b8
U zzo38
W 2093
This document is a list of the available SQL functions that you can use in the customization of Free Hero Mesh. In addition to the ones listed here, you can also use the [http://sqlite.org/lang_corefunc.html|core functions], [http://sqlite.org/lang_datefunc.html|date/time functions], and [http://sqlite.org/lang_aggfunc.html|aggregate functions], of SQLite, as well as any functions defined by extensions. See also: [SQL tables].

(Note: This is only a draft and is likely to change in future.)

Asterisks in the headings indicate aggregate functions.

<h2>BASENAME()</h2>
Returns the base name, which is a copy of the first command-line argument (other than switches).

<h2>LEVEL()</h2>
Returns the one-based order number of the current level.

<h2>LEVEL_CACHEID()</h2>
Returns the ID number of the active level file in the user cache table.

<h2>LEVEL_ID()</h2>
Returns the ID number of the current level.

<h2>MODSTATE()</h2>
Get the current keyboard modifiers state. It is the sum of the following:
  *  0x0001: Left shift
  *  0x0002: Right shift
  *  0x0040: Left control
  *  0x0080: Right control
  *  0x0100: Left alt
  *  0x0200: Right alt
  *  0x0400: Left meta
  *  0x0800: Right meta
  *  0x1000: Num lock
  *  0x2000: Caps lock
  *  0x4000: Mode

<h2>MOVENUMBER()</h2>
Tells you how many moves have been played so far since it has been reset.

<h2>PICTURE_SIZE()</h2>
Tell you the picture size.

<h2>RESOURCE(...)</h2>
Given a list of strings, find the matching resource from the .heromeshrc file and command-line arguments. Result is null if there is no such resource value.

<h2>SIGN_EXTEND(num)</h2>
Sign-extend a 32-bit integer to 64-bits. The 32-bit user variables in Free Hero Mesh might or might not be signed, so when accessing them in SQL (which uses 64-bit numbers) you must use this if you want to treat it as a signed number.

<h2>SOLUTION_CACHEID()</h2>
Returns the ID number of the active level file in the user cache table.

<h2>SOLUTION_REPLAY()</h2>
Returns 1 if replaying the solution or 0 for the normal game.

Z 8550cab452ca8230c492c5c9b36badcf