Jump to content

GUICtrlCreateListViewItem


nitekram
 Share

Recommended Posts

The following is the part of my code that is not working - $testlist is just for testing (not part of the code)

I would believe if the first condition ($testlist = 10) is true then it would follow the steps, but it stops after one time - only showing one file if you select 2 files - (the rest of the code is a For Loop for the other files that continues to look at the this code for all files selected)

The code that is followed if $testlist <> 10 runs and correctly shows both files or all files.

I have been pulling my hair out on this and thought I would get a different set of eyes to see what I am doing wrong - if I am not explaining myself right - please ask for more info

The consolewrite() is only there to show me if it is getting the right info - and from my point of view it is as it shows correctly in my list view, but like I said it stops after one file is shown.

If $testlist = 10 Then ;TEST with 10  having trouble with this type of For loop - stops after one file

    For $i = 0 To 3 step 1;last column number
        ConsoleWrite(' Running loop = #( ' & $i & ' )')
        If $i = 0 Then
            $tekst = _getsummaryprop($path,$i) & "|"
            If $tekst = '' Then
                ConsoleWrite(" 0-String = ''" & $tekst & @CRLF & $i & ' ' & $tekst & @CRLF & $i & @CRLF)
            Else
                ConsoleWrite(" 0-String = " & $tekst &@CRLF & $i & ' ' & $tekst & @CRLF)
            EndIf
        EndIf
        
        If $i = 1 Then
            $tekst = $tekst & _getsummaryprop($path,$i) & "|"
            If $tekst = '' Then
                ConsoleWrite(@CRLF & $i & ' ' & $tekst & @CRLF & $i & @CRLF)
            Else
                ConsoleWrite(@CRLF & $i & ' ' & $tekst & @CRLF)
            EndIf
        EndIf

        If $i = 2 Then
            $tekst = $tekst & _getsummaryprop($path,$i) & "|"
            If $tekst = '' Then
                ConsoleWrite(@CRLF & $i & ' ' & $tekst & @CRLF & $i & @CRLF)
            Else
                ConsoleWrite(@CRLF & $i & ' ' & $tekst & @CRLF)
            EndIf
        EndIf

        If $i = 3 Then
            $tekst = $tekst & _getsummaryprop($path,$i)
            If $tekst = '' Then
                ConsoleWrite(@CRLF & $i & ' ' & $tekst & @CRLF & $i & @CRLF)
            Else
                ConsoleWrite(@CRLF & $i & ' ' & $tekst & @CRLF)
            EndIf
        EndIf

        If $b_return >= 1 Or @error Then
            MsgBox('','ERROR 3923 ',$b_return );ExitLoop
            ConsoleWrite('ERROR = '& @error & @CRLF & $tekst & @CRLF)
        EndIf
    Next
    GUICtrlCreateListViewItem($tekst, $mylist)
    ConsoleWrite(@CRLF & 'Complete string = ' & $tekst & @CRLF)

Else
    $tekst = _getsummaryprop($path,0) & "|" & _getsummaryprop($path,1) & _
            "|" & _getsummaryprop($path,2) & "|" & _getsummaryprop($path,3)
    ConsoleWrite(@CRLF & $tekst & @CRLF)
    GUICtrlCreateListViewItem($tekst, $mylist)
EndIf

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

OK - I think I can drill this down to the simple question:

Is this code

$tekst = _getsummaryprop($path,0) & "|" & _getsummaryprop($path,1) & _
   "|" & _getsummaryprop($path,2) & "|" & _getsummaryprop($path,3)

The same as this code - and if not why?

$tekst = _getsummaryprop($path,0) & "|"
$tekst = $tekst & _getsummaryprop($path,1) & "|"
$tekst = $tekst & _getsummaryprop($path,2) & "|"
$tekst = $tekst & _getsummaryprop($path,3)

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

bumb

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

OK - I think I can drill this down to the simple question:

Is this code

$tekst = _getsummaryprop($path,0) & "|" & _getsummaryprop($path,1) & _
   "|" & _getsummaryprop($path,2) & "|" & _getsummaryprop($path,3)

The same as this code - and if not why?

$tekst = _getsummaryprop($path,0) & "|"
$tekst = $tekst & _getsummaryprop($path,1) & "|"
$tekst = $tekst & _getsummaryprop($path,2) & "|"
$tekst = $tekst & _getsummaryprop($path,3)
I will stick my neck out and say yes, both will achieve same thing, however without u posting the Func _getsummaryprop(), i cannot help further. Your function may be the cause and not returning an the expected result.

HardCopy

Edited by HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

I will stick my neck out and say yes, both will achieve same thing, however without u posting the Func _getsummaryprop(), i cannot help further. Your function may be the cause and not returning an the expected result.

HardCopy

Here is the function - _getsummaryprop() -

Func _getsummaryprop($path, $option)
    Select
        Case $option = 0
            Return $path
        Case $option = 1
            Return "author"
        Case $option = 2
            Return "company"
        Case $option = 3
            Return "catagory"
        Case Else
    EndSelect
EndFunc

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

Your code snippet is probably inside of some loop not published here.

I think problem may be in that "outer" loop, so post more code here...

Maybe variable $i used in inner loop is used also in outer loop?

You guys are so smart - I spent hours on this and never even thought about that being a problem. Once I changed my outer loop from $i to $it - everything worked as planned. I thank you for your, and I learned something about loops as well.

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...