PDA

View Full Version : Can't Get Multiple Forms to Work


plinydogg
01-22-2007, 11:16 PM
Ok. I've read the tutorial on making projects with multiple forms but I'm still not getting it for some reason. Here's what I do:

(1) Create a main form with a button;
(2) Create and save a second form and make sure that the "generate library" option is checked for this second form;
(3) Add #include "secondformname" in the initialization code section of the first form;
(4) On the OnClick button event, add the following code:
mainForm$ = Form100Create;
Form_Show(mainForm$);

I keep getting "duplicate proc" errors when I run it even though the second form is "generate library" and the two forms' names are different. What am I doing wrong?

Thanks in advance.

plinydogg
01-22-2007, 11:17 PM
In case it matters, I used the blank PPL project template (i.e., not Windows API).

kornalius
01-23-2007, 01:56 AM
You need to use the namespace name to call the functions:

mainform$ = ::Form200 Form200Create;
Form_Show(mainForm$);

The namespace is using the ClassName of the form. Make sure the two forms have a different &ClassName. The "duplicate proc" error is probably the &ClassName properties that are still PPLForm.

kornalius
01-23-2007, 01:58 AM
Could also be that you are not using the NameSpace option in the Form -> Form Options. The Menu5001 function will be duplicate since it is within the same namespace.

plinydogg
01-23-2007, 12:18 PM
Thanks for the help but I'm still having problems. In accordance with your advice I've done the following:

(1) Made sure that the NameSpace option is checked;
(2) Made sure that the &Classname for each form is different;
(3) Used the namespace form to call functions;

It's not a big deal...I'll just use tabs with control_show and control_hide for now...

plinydogg
01-23-2007, 12:20 PM
In any event, the "using multiple forms in your project" tutorial probably needs to be updated to say something about this namespace business.

kornalius
01-23-2007, 02:47 PM
Yes indeed it needs to be updated.

What error are you getting now in your project?

plinydogg
01-23-2007, 11:29 PM
PPL 1.12 Pro Compiler Error Report

error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (40,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (40,37)]
error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (44,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (44,37)]
error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (48,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (48,39)]
error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (52,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (52,39)]
error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (56,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (56,39)]
error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (60,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (60,39)]
error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (64,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (64,39)]
error: (c:\util\ppl\workbench\main.ppl) [Syntax error at 'CREATEEVENT' (66,3)]
error: (c:\util\ppl\workbench\main.ppl) [: or , expected at ';' (66,35)]
error: (c:\util\ppl\workbench\splash.frm#BITMAP101) [Syntax error at 'FORM_SHOW' (4,3)]
error: (c:\util\ppl\workbench\splash.frm#BITMAP101) [: or , expected at ';' (4,23)]

plinydogg
01-23-2007, 11:29 PM
If you need me to give you those errors in a more readable format, just let me know.

kornalius
01-24-2007, 04:49 PM
Thanks that is exactly what I was expecting. I am having the same issue here. I am working on it. Hopefully will get a fix today.

plinydogg
01-24-2007, 04:59 PM
No rush! I'm just glad that it wasn't something I was doing wrong.