View Full Version : Multiple forms
Phobos70
03-27-2007, 03:32 PM
Hi,
I'm trying to do a multiple form project, but I only have this compiler error:
"PPL 1.23 Pro Compiler Error Report
error: (f:\programmi\ppl\miei\test\test.ppl) [Syntax error at 'FORM200CREATE' (11,12)]"
This is the main part of my code:
#include "test_form.ppl"
#include "new_form.ppl"
func WinMain
Global(Form100$);
Global(Form200$);
::PPLForm FORM100Create;
::myform FORM200Create;
ShowWindow(FORM100$, SW_SHOWNORMAL);
SetForegroundWindow(FORM100$);
return (true);
end;
The two forms have different names and namespace...
Can you help me?
Luigi.
(sorry for my bad scholastic english!)
kornalius
03-28-2007, 04:03 AM
Please post "test_form.ppl" and "new_form.ppl" if you can.
Phobos70
03-28-2007, 06:42 AM
Here the whole project!
As you can see there are only two forms and one button.
where I'm wrong?
Thanks,
Luigi.[br]1175064132_308_FT4233_test.zip
Phobos70
03-28-2007, 06:49 AM
Ok, I have found the error!
In the new_form.ppl there is the func WinMain and not the FORM200Create!
Now it works!
Sorry!!!
plinydogg
03-28-2007, 12:42 PM
I think the multiple forms tutorial used to have an error in it in this regard, was it ever fixed?
kornalius
03-28-2007, 04:47 PM
Make sure New_Form.ppl is a Dialog form, Form -> Form Options -> Dialog Form.
Phobos70
03-30-2007, 06:47 AM
Dear Kornalius,
I still have a problem!
When I click on the button the first time it opens the info form. If I try the second time the program crashes!
I'm calling the INFOFormCreate in the WinMain function and not in the buttonclick function!
Is this my error?
If I try to put the call in the buttonclick function I have a syntax error!
Thank you!
Luigi.[br]1175237260_308_FT4233_test.zip
Bruno BASLI
03-30-2007, 01:55 PM
This works:
Form_Hide(INFOForm$);
//Form_Destroy(INFOForm$);
Phobos70
03-30-2007, 05:23 PM
Thank you Bruno, I'll try as soon as possible!!!
Luigi.
Phobos70
03-30-2007, 07:02 PM
emh... it was very simple...
It works, thank you Bruno!
Luigi.
Bruno BASLI
03-31-2007, 01:26 PM
good luck :-)
kornalius
03-31-2007, 08:23 PM
Thank you Bruno for helping solve this issue.
PointOfLight
03-31-2007, 09:07 PM
Because things have changed with namespaces and such, it might be time to revisit the multi-form tutorial. Also, I don't know if there's anything you can do, but it would be nice if there was an easier way to implement multiple forms. This will be a big turn-off for people migrating from most other development platforms that support forms, and possibly a deterrent for newbies looking for a development environment.
kornalius
04-01-2007, 02:38 AM
I agree Eric but what do you suggest? I am more than willing to make PPL easier but I will need some input.
zehlein
04-01-2007, 10:48 AM
I could imagine to expand the Project Manager's capabilities. Kind of adding a "Add new form to project " option that does all the necessary things -like declaring the new form as library- and so on. It should leave me with a simple call "ShowForm('MyNiceLittleForm');" and it would be done for me by that. Hmm, hope that it is understandable what I mean.
kornalius
04-01-2007, 02:57 PM
Maybe having a new form wizard might help, what do you guys think?
As for calling the form it will remain the same, the namespace has to be used:
MyLittleNiceForm::MyForm$ = MyForm_FormCreate;
Form_Show(MyNiceLittleForm::MyForm$);
zehlein
04-01-2007, 04:38 PM
Looks good to me, Alain.
Phobos70
04-01-2007, 06:13 PM
It would be great also fo me!
PointOfLight
04-02-2007, 12:41 AM
I think you guys are on the right track. If I could just do the "add form", and it created the form as a library and added the include for the library form in the appropriate spot, I wouldn't mind the extra work of adding the lines to actually call the form. You have to do that no matter what development environment you use. Maybe when you initially create the form you can even pop up a message showing the text that would need to be added to display the form.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.