gb_func::gb__val_data - Validate a .gbf String

Syntax

call "gb_func::gb__get_file","my.gbf",gb__gbf_data$,"",gb__err$"
call "gb_func::gb__val_data",gb__gbf_data$,gb__err,gb__err$"

Description

This routine scans the gb__gbf_data$ string, ensuring that there is a [Program] block with at least the variables "Program Name" and "Resource File", and that there are no more than one each of the "[Init]" and "[EOJ]" blocks.

This function also checks the format of the [Event] headers, according to the following format mask:

[Event Win=int{.int} ID=int Code=char{int{:int}} <EVENT_NAME> (SUBROUTINE_NAME)]

gb__ok=mask("","^\[Event Win=[0-9]+(.[0-9]+)* ID=[0-9]+ "+
: "Code=[A-Za-z0-9]([0-9]+(:[0-9]+)?)? "+
: "<[a-zA-Z0-9_]+> \([A-Za-z0-9_]+\)\]$")

The final step is to verify that the [Event] headers are consistent with the windows and controls in the resource file.

Possible Errors

gb__err

gb__err$

0

Success.

ERR

Unexpected error -- Visual PRO/5 ERR returned.

-1

Missing [Program] block.

-2

Multiple [Init] blocks.

-3

Multiple [EOJ] blocks.

-6

Missing 'Program Name' variable.

-7

Missing 'Resource File' variable.

-9

Invalid [Event] header structure.

-99

Couldn't find resource file.

-98

_qres::Enumerate_Res_Forms Error.

-97

_qres::Enumerate_Res_Child_Windows Error.

-96

_qres::Enumerate_Res_Controls Error.

-100

Formatted string identifying the windows/controls/events that were not in the resource file:

"win_id:c(8*=0),ctrl_id:c(5*=0),event_id:c(1*=0),code:c(1*=10)"

Window ID will be formatted like "10" or "10.200" or "10.200.200."

Control ID is a simple integer.

Event ID is a single character, optionally followed by an integer qualifier to be tested against gb__event.flags (e.g. 'f0'). Notify event codes will be formatted with the control type appended to the event code, i.e., 'N1:20' or 'N3:107'.

Code = 1: Window not in resource file.

Code = 2: Control not in window.

Code = 3: Illegal event code for this control type.