Sign in to follow this  
Followers 0
IvanCodin

ListView Error

5 posts in this topic

I am getting an error in my script. It points to a $GUI_SS_DEFAULT_LISTVIEW error and states it is possibly used before declaration. I looked at all of the include files and am not able to find a reference to the $GUI_SS_DEFAULT_LISTVIEW. Am I missing an include file perhaps? I just upgraded to the latest version if that makes a difference.

Here is the code:

CODE
#include <GUIConstants.au3>

#include "DBlistView.au3"

Opt("GUIOnEventMode", 1) ; OnEvent mode

Dim $title="Access db Viewer" ;gui title

Dim $gui = GUICreate($title, 800, 600)

GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

$DB=@ScriptDir & "\test.mdb" ;modify to location of your .mdb //does'nt handle relationships

$Query="Select * From CompanyName Order by CompanyName ASC" ;modify your query

$Number_of_Records_to_Display = 25 ;these variables are self explanitory...

$Listview_Left = 50

$Listview_Top = 50

$Listview_Width = 400

$Listview_Height = 400

$Listview_style = $GUI_SS_DEFAULT_LISTVIEW ;default is -1

$Listview_exStyle = $LVS_EX_FULLROWSELECT + $LVS_EX_GRIDLINES ;default is -1

;call the function

_createDBlistView($DB,$Query,$Number_of_Records_to_Display,$Listview_Left,$Listview_Top,$Listview_Width,$Listview_Height,$Listview_style,$Listview_exStyle)

GUISetState ()

While 1

Sleep(1000) ; Idle around

WEnd

Thanks

CC

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Thanks for the suggestion! I always struggle when and what include in my scripts and when would they be required. I changed the script to included the ListViewConstants.au3 and still get the following error.

AutoIt3 Syntax Checker v1.54.8 Copyright © Tylo 2007

E:\access\DBlistView.au3(18,58) : WARNING: $GUI_SS_DEFAULT_LISTVIEW: possibly used before declaration.

$Listview_style = $GUI_SS_DEFAULT_LISTVIEW ;default is -1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

The error looked a little odd in that it points to my script directory and not the AutoIt include directory in c:\Porgram Files\AutiIt\Include directory. So I changed the include from #include "DBListView.au3" to #include <DBlistView.au3>. It now looks like it is using the correct file.

Thanks for the assistance.!

CC

Edited by IvanCodin

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It worked perfectly! Thank You! I now have a list displayed for the query.

Why did you have me include ListViewConstants.au3 in DBListView.au3 and not my Main script?

CC

Edited by IvanCodin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0