checkStringFormat()

The function checks, wether the string 'value' is according the format in 'format' (for example, "%5.4f").

Synopsis

bool checkStringFormat( string value, string format);

Parameters

Parameter Description
value Value to be checked
format Specified format, to which the value has to fit

Return Value

With TRUE the Format is OK, FALSE means a wrong format.

Errors

Missing arguments of the function

Description

Checks, wether the value in a text field is according to the specified format.

Example

Create a text field in a panel with the format "4.3f". A button checks, wether the textfield has the format "4d": a long as you edit only 4 numbers, the format is OK, any other format returns FALSE for your text field format.

main()
{
  bool x;
  string text, format;
  getValue("TextField1", "text", text);
  x = checkStringFormat(text, "4d");
  DebugN(x);
}

Assignment

Graphics function

Availability

UI