Seite 1 von 1

isf styles Variable not devined

Verfasst: Do 29. Mai 2014, 04:30
von SilKoBo
Nice IDE, thanks!

I'm getting variable not defined using isf form with styles.

This is the test program:

Code: Alles auswählen

;*****************************************
;TestPopup.au3 by test
;Created with ISN AutoIt Studio v. 0.96 BETA
;*****************************************

Opt("GUIOnEventMode", 1) 

#include "Forms\TestPopup.isf"
#include <GuiButton.au3>

GUISetState(@SW_SHOW, $TestPopup)
While (1=1)
	sleep(10)
WEnd

Func BTN_Exit()
	Exit
EndFunc

This isf without the winpopup works fine:

Code: Alles auswählen

; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>

$TestPopup = GUICreate("TestPopup",253,115,-1,-1,-1,-1)
GUICtrlCreateButton("exit",20,20,100,30,-1,-1)
GUICtrlSetOnEvent(-1,"BTN_Exit")
GUISetState(@SW_SHOW,$TestPopup)


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd
With $WS_POPUPWINDOW, it throws the Variable Not Declared error:

Code: Alles auswählen

; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>

$TestPopup = GUICreate("TestPopup",253,115,-1,-1,$WS_POPUPWINDOW,-1)
GUICtrlCreateButton("exit",20,20,100,30,-1,-1)
GUICtrlSetOnEvent(-1,"BTN_Exit")
GUISetState(@SW_SHOW,$TestPopup)


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd

Unless I copy the code and paste it into the program, and disable the form include:

Code: Alles auswählen

;*****************************************
;TestPopup.au3 by test
;Created with ISN AutoIt Studio v. 0.96 BETA
;*****************************************

Opt("GUIOnEventMode", 1) 

;#include "Forms\TestPopup.isf"
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>

; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ;

$TestPopup = GUICreate("TestPopup",253,115,-1,-1,$WS_POPUPWINDOW,-1)
GUICtrlCreateButton("exit",20,20,100,30,-1,-1)
GUICtrlSetOnEvent(-1,"BTN_Exit")
GUISetState(@SW_SHOW, $TestPopup)

While (1=1)
	sleep(10)
WEnd

Func BTN_Exit()
	Exit
EndFunc

It seems to be something to do with how the include is included...

Re: isf styles Variable not devined

Verfasst: Di 19. Aug 2014, 10:08
von ISI360
Hi SilKoBo!

Sorry for my late answer.
In ISN v. 0.96 BETA the .isf contain no Includes! So you have to add it in your mainscript manually.

But with the next version (0.97 BETA) the includes are inserted in the .isf automatically! (With #include-once)
So you just need to include the .isf and show the GUI with GuiCtrlSetState. (As you do it in your first example)

Hope this helps you.