Page 1 of 1

Undeclared Identifier

Posted: 16 Aug 2019 9:37
by Loffy
Thomas,

Re the error, it was in the automatic code for a dialog box. (The box was quite small with four controls: text; edit; OK; Cancel).

Last night I recalled that I had reduced the size of the dialog window to more closely relate to the size of the dialogs. So I went back and enlarged the dialog window.

The problem went away. (And I do not have a screenshot of the error and code). Sorry.

However, today I tried to repeat the error and I can't. Even after making the dialog box quite small the problem does not happen.

Attached you will find a text copy of the relevant code as it exists today.

My question is why did the error yesterday refer to the setRect line as setRect/5 when the code today only has 4 arguments?.

I will do better next time if I have an automatic code error.

Regards,

Loffy

Re: Undeclared Identifier

Posted: 16 Aug 2019 11:28
by Thomas Linder Puls
Just include code directly in the text (enclosing it by [code]..[/code]) tags, then it will look like this:

Code: Select all

% This code is maintained automatically, do not update it manually. %  17:51:34-16.8.2019   facts     ok_ctl : button.     cancel_ctl : button.     id_ctl : editControl.   predicates     generatedInitialize : (). clauses     generatedInitialize() :-         setText("prime"),         setRect(rct(50, 40, 172, 114)),         setModal(true),         setDecoration(titlebar([closeButton])),         setState([wsf_NoClipSiblings]),         id_ctl := editControl::new(This),         id_ctl:setText(""),         id_ctl:setPosition(68, 12),         id_ctl:setWidth(44),         id_ctl:setHeight(18),         id_ctl:setMultiLine(),         ok_ctl := button::newOk(This),         ok_ctl:setText("&OK"),         ok_ctl:setPosition(12, 46),         ok_ctl:setSize(32, 16),         ok_ctl:defaultHeight := false,         ok_ctl:setAnchors([control::right, control::bottom]),         ok_ctl:setClickResponder(onOkClick),         cancel_ctl := button::newCancel(This),         cancel_ctl:setText("Cancel"),         cancel_ctl:setPosition(68, 46),         cancel_ctl:setSize(40, 16),         cancel_ctl:defaultHeight := false,         cancel_ctl:setAnchors([control::right, control::bottom]),         StaticText_ctl = textControl::new(This),         StaticText_ctl:setText("User ID :"),         StaticText_ctl:setPosition(12, 10),         StaticText_ctl:setSize(36, 18). % end of automatic code   end implement prime
The code as it exists today does not have any problems. If you find a way to reproduce the problem let us hear about it.

Re: Undeclared Identifier

Posted: 16 Aug 2019 12:27
by Harrison Pratt
"My question is why did the error yesterday refer to the setRect line as setRect/5 when the code today only has 4 arguments?."

Sometimes the dialog editor gets out of synch with the .pro file's automatically generated code after deleting some controls. If you get stuck in that error cycle just comment out the offending line of code with a leading '%' and rebuild the package containing the troublesome dialog. Right-clicking on the dialog layout tool in the dialog editor and selecting Update and View code should work, too.

When you changed the dialog size (and maybe some controls) you forced regeneration of the automatically generated code.

Re: Undeclared Identifier

Posted: 16 Aug 2019 14:25
by Loffy
Thomas and Harrison,

Thanks, and understood.

Regards,

Loffy