window release method compile error
Moderator: Rathinagiri
window release method compile error
I must have a fundamental problem understanding methods.
I want to release a window then go back to a previous one. In the code below, why does the build give me a syntax error
at either the hide or release command at the end. Form_1 is the destination after leaving form_3
*------------------------------------------------------------*
FUNCTION BackToInputScreen //called from SelectInput
*------------------------------------------------------------*
Form_1.setfocus
if lUseTestData //
xDummy:=ScanToFillBlanks(.f.)
else
Form_1.ebox_1.visible:=.T. //get numbers
Form_1.ebox_1.setfocus
Form_1.Lbl_3.visible:= .T. //instructions
endif
Form_1.startbutton.visible:= .F.
Form_1.updatearray.visible:= .T.
Form_1.updatearray.setfocus
//Form_3.hide
Form_3.release
RETURN NIL
I want to release a window then go back to a previous one. In the code below, why does the build give me a syntax error
at either the hide or release command at the end. Form_1 is the destination after leaving form_3
*------------------------------------------------------------*
FUNCTION BackToInputScreen //called from SelectInput
*------------------------------------------------------------*
Form_1.setfocus
if lUseTestData //
xDummy:=ScanToFillBlanks(.f.)
else
Form_1.ebox_1.visible:=.T. //get numbers
Form_1.ebox_1.setfocus
Form_1.Lbl_3.visible:= .T. //instructions
endif
Form_1.startbutton.visible:= .F.
Form_1.updatearray.visible:= .T.
Form_1.updatearray.setfocus
//Form_3.hide
Form_3.release
RETURN NIL
Re: window release method compile error
It's impossiple to analyze your code without complete sample.
Re: window release method compile error
To Mol
The complete code is way too big
The HMG reference for the release method just says that <windowname>.release will close it
That sounds simple but it is not happening on the last line either for Hide or release.
Is there anything else that any user should know about using a method?
Thanks
The complete code is way too big
The HMG reference for the release method just says that <windowname>.release will close it
That sounds simple but it is not happening on the last line either for Hide or release.
Is there anything else that any user should know about using a method?
Thanks
Re: window release method compile error
Try to declare window by
Paste error message here, too.
Code: Select all
declare window Form_3
- serge_girard
- Posts: 3167
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: window release method compile error
Hi Bluebird,
Maybe a small part of the program will be sufficient to understand the problem?
Serge
Maybe a small part of the program will be sufficient to understand the problem?
Serge
There's nothing you can do that can't be done...
Re: window release method compile error
Thanks to those kind souls who responded
error is Error E0030 syntax error " Syntax error at '.'"
Code below shows window Form_3 and function called to exit back to Form_1
*------------------------------------------------------------*
FUNCTION SELECTINPUT() //Called from Startup Button
*------------------------------------------------------------*
If !IsWindowDefined(Form_3)
DEFINE WINDOW Form_3 ;
AT 290,290 ;
WIDTH 400 ;
HEIGHT 300 ;
BACKCOLOR GREEN ;
TITLE "Choices"
@ 50 ,100 BUTTON Button_1 ;
PARENT Form_3;
CAPTION "Click to Use Set Values" ;
ONCLICK {||(lUseTestData:=.t.,BackToInputScreen())} ;
WIDTH 200 ;
FONT "Arial" SIZE 12 ;
HEIGHT 35
@ 100 ,100 BUTTON Button_2 ;
PARENT Form_3;
CAPTION "Click to enter New Values" ;
ONCLICK {||(lUseTestData:=.f.,BackToInputScreen())} ;
FONT "Arial" SIZE 12 ;
WIDTH 200 ;
HEIGHT 35
END WINDOW
ACTIVATE WINDOW Form_3
Else
Form_3.setfocus
Endif
RETURN NIL
*------------------------------------------------------------*
FUNCTION BackToInputScreen() //called from SelectInput
*------------------------------------------------------------*
Form_1.setfocus
if lUseTestData //
xDummy:=ScanToFillBlanks(.f.)
else
Form_1.ebox_1.visible:=.T. //get numbers
Form_1.ebox_1.setfocus
Form_1.Lbl_3.visible:= .T. //instructions
endif
Form_1.startbutton.visible:= .F.
Form_1.DisplayClues.visible:= .T.
Form_1.DisplayClues.setfocus
//Form_3.hide
Form_3.release
RETURN NIL
error is Error E0030 syntax error " Syntax error at '.'"
Code below shows window Form_3 and function called to exit back to Form_1
*------------------------------------------------------------*
FUNCTION SELECTINPUT() //Called from Startup Button
*------------------------------------------------------------*
If !IsWindowDefined(Form_3)
DEFINE WINDOW Form_3 ;
AT 290,290 ;
WIDTH 400 ;
HEIGHT 300 ;
BACKCOLOR GREEN ;
TITLE "Choices"
@ 50 ,100 BUTTON Button_1 ;
PARENT Form_3;
CAPTION "Click to Use Set Values" ;
ONCLICK {||(lUseTestData:=.t.,BackToInputScreen())} ;
WIDTH 200 ;
FONT "Arial" SIZE 12 ;
HEIGHT 35
@ 100 ,100 BUTTON Button_2 ;
PARENT Form_3;
CAPTION "Click to enter New Values" ;
ONCLICK {||(lUseTestData:=.f.,BackToInputScreen())} ;
FONT "Arial" SIZE 12 ;
WIDTH 200 ;
HEIGHT 35
END WINDOW
ACTIVATE WINDOW Form_3
Else
Form_3.setfocus
Endif
RETURN NIL
*------------------------------------------------------------*
FUNCTION BackToInputScreen() //called from SelectInput
*------------------------------------------------------------*
Form_1.setfocus
if lUseTestData //
xDummy:=ScanToFillBlanks(.f.)
else
Form_1.ebox_1.visible:=.T. //get numbers
Form_1.ebox_1.setfocus
Form_1.Lbl_3.visible:= .T. //instructions
endif
Form_1.startbutton.visible:= .F.
Form_1.DisplayClues.visible:= .T.
Form_1.DisplayClues.setfocus
//Form_3.hide
Form_3.release
RETURN NIL
Re: window release method compile error
try to build whole complete working sample. Respect our time, please...
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: window release method compile error
Can you zip files and attach?
- serge_girard
- Posts: 3167
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: window release method compile error
Hello Bluebird,
Extremly difficult without main function. I tried to make the main function myself (as simple as possible) and it seems working.
See below:
Serge
Extremly difficult without main function. I tried to make the main function myself (as simple as possible) and it seems working.
See below:
Code: Select all
#include "hmg.ch"
DEFINE WINDOW Form_1 ;
AT 0,500 ;
WIDTH 1300 ;
HEIGHT 850 ;
TITLE 't' ;
BACKCOLOR SILVER;
MAIN ;
ON INIT SELECTINPUT();
END WINDOW
ACTIVATE WINDOW Form_1
*------------------------------------------------------------*
FUNCTION SELECTINPUT() //Called from Startup Button
*------------------------------------------------------------*
//lUseTestData := .f.
If !IsWindowDefined(Form_3)
DEFINE WINDOW Form_3 ;
AT 290,290 ;
WIDTH 400 ;
HEIGHT 300 ;
BACKCOLOR GREEN ;
TITLE "Choices"
@ 50 ,100 BUTTON Button_1 ;
PARENT Form_3;
CAPTION "Click to Use Set Values" ;
ONCLICK {||(lUseTestData:=.t.,BackToInputScreen())} ;
WIDTH 200 ;
FONT "Arial" SIZE 12 ;
HEIGHT 35
@ 100 ,100 BUTTON Button_2 ;
PARENT Form_3;
CAPTION "Click to enter New Values" ;
ONCLICK {||(lUseTestData:=.f.,BackToInputScreen())} ;
FONT "Arial" SIZE 12 ;
WIDTH 200 ;
HEIGHT 35
END WINDOW
ACTIVATE WINDOW Form_3
Else
Form_3.setfocus
Endif
RETURN NIL
*------------------------------------------------------------*
FUNCTION BackToInputScreen() //called from SelectInput
*------------------------------------------------------------*
Form_1.setfocus
if lUseTestData //
xDummy:= '' //ScanToFillBlanks(.f.)
else
//Form_1.ebox_1.visible:=.T. //get numbers
//Form_1.ebox_1.setfocus
//Form_1.Lbl_3.visible:= .T. //instructions
endif
//Form_1.startbutton.visible:= .F.
//Form_1.DisplayClues.visible:= .T.
//Form_1.DisplayClues.setfocus
//Form_3.hide
Form_3.release
RETURN NIL
There's nothing you can do that can't be done...
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: window release method compile error
Hi BlueBird ....
Code: Select all
IF !IsWindowDefined( Stock ) ..... You Form_3
Load Window .\Formularios\Stock
ON KEY SHIFT + DELETE OF Stock ACTION .......
ON KEY F3 OF Stock ACTION ......
DesactivarEdicion()
ConectarStock( .T. )
Stock.Activate
Else
ConectarStock( .T. )
Stock.Restore
Stock.Setfocus
EndIf
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO