Dear All,
Just tried my first project with Visual PPL: the "for dummies" example. But after looking at it for a quarter or so, I gave up.
What's wrong? Anybody?
By the way:
+ what does #code {..} do?
Many thanks.
Marcel
Just tried my first project with Visual PPL: the "for dummies" example. But after looking at it for a quarter or so, I gave up.
What's wrong? Anybody?
By the way:
+ what does #code {..} do?
Many thanks.
Marcel
- Code:
#define FORM100 100
#define BUTTON101 101
#define MEMO102 102
#code {test.frm#}
proc HelloWorld
t$=GetText(MEMO102$);
s$=t$ + "\n" + "Hello World!";
SetText(MEMO102$,s$);
end;
#code {test.frm#FORM100}
func FORM100Proc (hWnd$, Msg$, wParam$, lParam$)
ok$ = true;
case(Msg$)
WM_COMMAND:
wmId$ = LOWORD(wParam$);
wmEvent$ = HIWORD(wParam$);
case(wmId$)
1001: // Exit
PostMessage(hWnd$, WM_CLOSE, 0, 0);
return(false);
101: // Button
HelloWorld;
end;
end;
return (ok$);
end;
#code {test.frm}
func WinMain
Global(FORM100$, BUTTON101$, MEMO102$, m1000$);
FORM100$ = NewForm("FORM100", "PPLForm", &FORM100Proc;);
BUTTON101$ = NewControl(101, "BUTTON", NULL, "BUTTON", WS_VISIBLE|WS_TABSTOP, FORM100$, 88, 208, 64, 24);
MEMO102$ = NewControl(102, "EDIT", NULL, "Click on the button", ES_AUTOHSCROLL|ES_AUTOVSCROLL|ES_MULTILINE|ES_WANTRETURN|WS_VISIBLE|WS_BORDER|WS_HSCROLL|WS_VSCROLL, FORM100$, 32, 8, 176, 136);
list(keys$);
if (Count(keys$) > 0)
CreateAccelTable(FORM100$, keys$);
end;
m1000$ = NewMenu(FORM100$, "File", 1000);
NewMenuItem(m1000$, -1, "Exit", 1001);
ShowWindow(FORM100$, SW_SHOW);
SetForegroundWindow(FORM100$);
#code {test.frm#}
return (true);
end;