Opened 14 years ago
Closed 14 years ago
#1680 closed Bug (No Bug)
Global variable gives "Variable used without being declared" in SQLite.au3
Reported by: | willichan | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | 3.3.6.0 | Severity: | None |
Keywords: | Cc: |
Description
I have been trying to figure this one out for a while. I get a "Variable used without being declared" error intermittently when using the SQLite.au3 include file. The error indicates line 1143 and the variable $g_hDll_SQLite. I have checked the file, and both variables referenced ($g_hDll_SQLite and $SQLITE_MISUSE) are declared globally at the top of the file.
Attachments (3)
Change History (17)
Changed 14 years ago by willichan
comment:1 follow-up: ↓ 3 Changed 14 years ago by jchd
I believe this is much more a question to ask on the support forum. So please don't follow up here and post there with a simple reproducer.
comment:2 Changed 14 years ago by Jpm
Without any script to reproduce I will close it.
Understand we don't have cristall balls...
perhaps related with the COntinueLoop I just fix
comment:3 in reply to: ↑ 1 Changed 14 years ago by willichan
jchd, Jpm,
This would actually be a bug in the script processor, not in any particular script of mine. SQLite.au3 is an include that comes with AutoIt3, so you do have the pertinent source script to look at, to confirm that the variables are globally declared and assigned values before they are used. No crystal balls required, just look at the SQLite.au3 code. I am not aware of anything I could put in my script that would un-declare a variable that has already declared globally.
I apologize if this post comes across as combative, I do not intend it that way. I am merely trying to address your responses.
As Jpm mentioned a bugfix that it may be related to, I will wait for the new release before posting regarding this in the forums as suggested.
comment:4 follow-up: ↓ 5 Changed 14 years ago by Jpm
If it is related to my fix you must have a wrong ContinueLoop X in your script.
Can you PM me your script so I can have a look to confirm that it is realated or not?
When You post a track a repro script is always needed Trivial error are not so trivial. That's why I need more than a cristall ball.
Thanks for your cooperation
comment:5 in reply to: ↑ 4 Changed 14 years ago by anonymous
Replying to Jpm:
If it is related to my fix you must have a wrong ContinueLoop X in your script.
Can you PM me your script so I can have a look to confirm that it is realated or not?
When I am back in the office on Monday, I will PM the script to you.
When you mentioned the bugfix, I did not realize it was for the ContinueLoop command, but rather thought is was for the script processor's internal workings. I doubt this is related to my issue. I do not see how a ContinueLoop statement could cause a variable globally declared at the top of an included file to become un-declared for a Func contained within that same include file. The script processor is somehow loosing track of a globally declared variable. Was this a symptom of the ContinueLoop bug?
comment:6 follow-up: ↓ 7 Changed 14 years ago by jchd
The trac space isn't for seeking help with how to properly use include files.
As I already advised, post in the help forum a short reproducer.
comment:7 in reply to: ↑ 6 Changed 14 years ago by willichan
Replying to jchd:
The trac space isn't for seeking help with how to properly use include files.
As I already advised, post in the help forum a short reproducer.
I am not seeking help with properly using an include file. I am reporting a bug with the script processor. Please read the posts more carefully.
comment:8 follow-up: ↓ 9 Changed 14 years ago by jchd
Can you please stop discussing this here and post to the help forum, along with a simple script so that we can at least investigate what's going on. I, like so many around, use the current SQLite UDF in numerous scripts without such problems.
comment:9 in reply to: ↑ 8 Changed 14 years ago by anonymous
Replying to jchd:
Can you please stop discussing this here and post to the help forum, along with a simple script so that we can at least investigate what's going on. I, like so many around, use the current SQLite UDF in numerous scripts without such problems.
I am reporting a bug with the script processor here, not a problem with the SQLite UDF. The SQLite UDF --is-- the example of the problem. I have also already told Jpm that I would send him my script to review. If you cannot read the posts, please do not respond. I do use the forums when I need help with something. In this case, I am reporting a bug. This --is-- the appropriate place for that. If you follow the posts, and actually look at the error message as attached, and look at the code of the UDF I gave as an example, the issue should be clear.
Unless you can explain to me how a globally declared variable can become UN-DECLAIRED, please stop trying to talk to me like I'm some kind of idiot. At least I know how to follow a line of logic.
comment:10 Changed 14 years ago by Valik
You are not reporting a bug, you are speculating that a bug may exist simply because something is happening that you do not expect. To date you have not demonstrated there is a bug. All you have demonstrated is a flagrant disregard for someone heavily involved with the SQLite functions and a whole lot of arrogance that it can't possibly be your code at fault (code you have yet to produce or narrow down the scope of).
jhcd is absolutely 100% right, you should not be posting on the issue tracker. You have not demonstrated a bug in the language. You need support if for no other reason than to determine you have found a bug in the first place. If you bothered to spend 30 seconds reading the big red box when you created this ticket you would see that posting a script to demonstrate the problem is part of the requirements for creating a bug report. You have failed to follow instructions when inserted in a rather large and obvious box and you have failed to follow instructions given to you by someone who knows the code best. Why should we even consider there is a bug in the code and not just some absurd mistake on your part when you fail to follow instructions?
comment:11 Changed 14 years ago by willichan
I am not going to continue with a battle here. You don't know me from spit, and I can appreciate that. My only beef here is with jchd's condescension. If I am 100% wrong, or even less than that, I am willing to eat crow. But if I am not wrong, he can have the bird for his lunch.
I have driven to my office (rather than waiting for Monday), and got a copy of the script that generated the error I attached originally. It has been tested with the beta version 3.3.5.6, and with versions 3.3.4.0, 3.3.6.0, and 3.3.6.1; each version generating intermittent (as stated in the original post) results. I will attach it here for your reference. I will admit that this is not the cleanest example of my coding (I haven't done much serious programming since the cassette drive on my Commodore PET died.), however I will also provide you with a logical flow below that should show you that the information I gave from the start should have been sufficient to anyone who looked at it seriously, to see the problem, even without my script. Afterward, I really do not care what direction you go with it. Well actually, I do, since I care about AutoIt (the only motivation I had for posting in the first place), and appreciate all the work and effort that goes into it ... but I am done pushing the issue.
Let me point out that this is not an error with SQLite.au3. This is just the error that I was able to reproduce from an uncompiled copy, allowing me to capture the line number and file name where the error occurred. Given that this is an intermittent error, and many times it happens at a user's desk from a compiled version, I am sure you can understand the difficulty and frustration in trying to get a screen-shot to establish my findings before posting.
Ok. Here we go.
1 - Given the error message "Variable used without being declared" shows line number 1143 in SQLite.au3, SQLite.au3 must have already been included prior to this error occurring.
2 - Given AutoIt does not have a command to undeclare a variable (unless there is an undocumented one. but that still would make no difference here, since if I don't know about it, I wouldn't be using it) once a variable is declared, it remains declared until its scope ends (which in the case of a Global scope, is not until the script terminates).
3 - Since both of the variables, $g_hDll_SQLite and $SQLITE_MISUSE, are defined in the Global scope (on lines 164 and 147 respectively), and occur outside of any Func definition, AND given #1 and #2, they are defined and assigned their values at the time the file is included, and prior to any possibility of line 1143 being executed or the error occurring.
4 - Since the script processor is reporting that the previously Globally declared variables are not declared, either it has lost track of the variables, or is reporting the wrong error message for whatever error is occurring. Either case being a bug in the script processor.
Now, if I just happened to have caught someone on a bad day, that's fine. We can let bygones be bygones. If you check my posting history on the forums, you will find that I am not one to go on the offensive or make personal attacks. I am not a self aggrandizing poster. I only post when I have something constructive to contribute, and if not, I just keep my mouth shut. I have contributed here what I deemed to be constructive, and now I will keep my mouth shut, unless one of you feels there something you need from me, that would be constructive, that I have left out. I will not make myself available for any further argument.
Thank you.
Changed 14 years ago by willichan
comment:12 Changed 14 years ago by Jpm
Can you add the #include <OneInstance.au3> if it is needed?
a small copy of WhatIE.db is also needed
Thanks
Changed 14 years ago by willichan
comment:13 Changed 14 years ago by jchd
Please read and follow up in this thread http://www.autoitscript.com/forum/index.php?showtopic=116099&view=findpost&p=810332.
comment:14 Changed 14 years ago by Jpm
- Resolution set to No Bug
- Status changed from new to closed
Thanks jchd for the identification of the "No BUG"
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
The error that shouldn't be