Checking input data
Checking answers (1)
The answers entered in the panel are automatically checked. This automatic check assumes that the answer is a numerical value. If this is not the case, CADMATIC Hull will alert the user, who must correct the answer before he can continue. In some cases, for example an angle for which no value entered should be interpreted as 0 degrees, this automatic check is not useful: if the user wants the answer to be 0 and therefore does not enter this value, he will nevertheless receive an error message. To avoid this, Check can be set to 'nocheck':
Check='nocheck'
The default value for Check is 'check', which means all answers will be checked. The consequences of 'nocheck' will be explained later. Label 2 must be used if Check is set to 'nocheck'. However, it is advisable to check the values entered, to ensure that no unexpected results will occur.
Retrieving answers
Label 2 enables the retrieval of answers. Several commands may be used for this purpose. These are explained in the xEagle syntax manual. Here, we will only explain their general purpose.
Label 2 is intended for checking whether answers given are correct. To know which answers have been given, the fetch command must be used. Care should be taken to ensure that the right button number is used for the right answer. As a rule, answer 1 should be fetched from button 2 and answer 2 from button 4. An example of the fetch command is:
fetch p=functieSub1ID, b=2, t=Ans[1]
fetch p=functieSub1ID, b=6, t=Ans[3]
The panel number 'p=functieSub1ID' is set by CADMATIC Hull and should always be used in this manner. The answers are stored in Ans[1] and Ans[3].
The CADMATIC Hull software only uses label 2 if the Check command has been set to 'nocheck' in label 1.
Checking answers (2)
The necessity of checking answers is decided by the systems manager. To check whether an answer is a numerical value, the CADMATIC Hull function 'do lb1/fetconv(@ans)' may be used. If the answer is incorrect, the answer given is replaced by 'error'. Other checks may also be performed, for example checking whether the answer is too large or too small. These checks are performed with the standard Xeagle macro language. Please consult the Eagle syntax manual for further explanation. Below is an example of a combination of checks:
if ^Ans[1]<10 : Ans[1]='error'
do lb1/fetconv( @Ans[1] )
if Ans[1]='error' : shape_ok=''
else shape_ok='ok'
The command 'shape_ok' ultimately determines if the answers will be accepted. It should be set to 'ok' when everything is correct. If this variable becomes empty, the user will be obliged to provide a different answer. The following is another example, with two questions and answers.
if ^Ans[1]<10 : Ans[1]='error'
do lb1/fetconv( @Ans[1] )
if ^Ans[2]>100 : Ans[1]='100'
do lb1/fetconv( @Ans[1] )
if Ans[1]='error' | Ans[2]='error' : shape_ok=''
else shape_ok='ok'
Error messages
The user may be given a hint about his error. This can be done by calling the standard function NotErr. An example of a NotErr call is the following.
Hint='Value A entered incorrectly'
Do -gui/NotErr