Jump to content

Forgot how to add strings together


 Share

Recommended Posts

func find()
    $search = FileFindFirstFile("*.jpg*")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    
;MsgBox(0, "", $filelist)
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
    $filelist += ", " & $file                                             <--Trying to add the strings here. Does not work
WEnd

; Close the search handle
FileClose($search)

I'm basically trying to get a string with a list of .jpg files in the directory delimited by commas.

Link to comment
Share on other sites

Or the long way, if you forget the shorthand version...

$filelist = $fileslist & ", " & $file

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Real men don't use the '&' operator :):lmao:

MsgBox(0,"",ManlyHardcoreStringConjugating("Good"," Night"))

Func ManlyHardcoreStringConjugating($s1,$s2)
    $struct=DllStructCreate("wchar["&StringLen($s1)+StringLen($s2)&"]")
    DllStructSetData($struct,1,$s1)
    DllStructSetData(DllStructCreate("wchar["&StringLen($s2)&"]",DllStructGetPtr($struct)+StringLen($s1)*2),1,$s2)
    Return DllStructGetData($struct,1)  
EndFunc

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

@monoceres

:) now you have to make all your future scripts like that :shhh: (or are you not a real man? :lmao: )

Of course, my way is the only way.

Real men don't have computers.... :think:

8)

Tell me about it, I've never even used a computer. I write all my scripts on a theoretical basis and have a friend post them to this forum.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Real men don't use the '&' operator :):lmao:

MsgBox(0,"",ManlyHardcoreStringConjugating("Good"," Night"))

Func ManlyHardcoreStringConjugating($s1,$s2)
    $struct=DllStructCreate("wchar["&StringLen($s1)+StringLen($s2)&"]")
    DllStructSetData($struct,1,$s1)
    DllStructSetData(DllStructCreate("wchar["&StringLen($s2)&"]",DllStructGetPtr($struct)+StringLen($s1)*2),1,$s2)
    Return DllStructGetData($struct,1)  
EndFunc
Monoceres divides by zero! :think:

$struct=DllStructCreate("wchar["&StringLen($s1)+StringLen($s2)&"]")

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...