Modify ↓
#3204 closed Bug (No Bug)
"if" function does not see variables that contain _IE objects as being "true"
| Reported by: | mexykanu | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.14.2 | Severity: | None |
| Keywords: | Cc: |
Description
Hello,
We have the following code:
Global $oIE = _IEAttach("your website","url")
local $body1 = _IETagNameGetCollection($oie,'body',0)
local $body2 = False
local $body3 = True
local $body4 = 'text'
local $body5 = 2
if $body1 Then
MsgBox(0,'','body1 is not empty')
EndIf
if $body2 Then
MsgBox(0,'','body2 is not empty')
EndIf
if $body3 Then
MsgBox(0,'','body3 is not empty')
EndIf
if $body4 Then
MsgBox(0,'','body4 is not empty')
EndIf
if $body5 Then
MsgBox(0,'','body5 is not empty')
EndIf
Issue: if $body1 does not return True but the variable $body1 contains information. This is very confusing and generates a lot of wasted time debugging code that has no bugs.
Workaround: using the following code returns True
if $body1 <> '' Then
Attachments (0)
Change History (2)
comment:1 by , 10 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
comment:2 by , 10 years ago
OK, But what is an autoit bug then ?! Doesn't this bug relate to the "if" function in AutoIt ?
Note:
See TracTickets
for help on using tickets.

This is not AutoIt or UDF bug.
This is not support forum.
Ask here:
https://www.autoitscript.com/forum/forum/2-autoit-general-help-and-support/