Jump to content
Sign in to follow this  
ATR

simultaneously use a function

Recommended Posts

ATR

Hi all,

I have a function, lots of variables

And I want use my function simultaneously with differents variables instead of browse all variables one by one

 

Thanks in advance

Share this post


Link to post
Share on other sites
Melba23

ATR,

I am afraid you will need to use the Alpha 3.4.11.1 version which will be released some time in early 2017. :)

Seriously, how can you expect a serious answer to such a vague question? How about showing us the function and explaining what all these variables are? ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
ATR

$i = 1
$x = 1
$Dossier = @WorkingDir & "\Folder\"
$Recherche = FileFindFirstFile($Dossier & "*.txt")
While 1
    $Fichier = FileFindNextFile($Recherche)
    If @error Then ExitLoop
    $Read = FileRead($Dossier & $Fichier)
    $Vars = StringSplit($Read, ';', 2)
    $Fichiers = FileOpen(@WorkingDir & "\File_" & $x & ".txt", 138)
    For $Var In $Vars
        TraySetToolTip("Siren n° : " & $i)
        FileWrite($Fichiers, Function($Var))
        $i += 1
        If $i = 15000 Then
            FileClose($Fichiers)
            $Fichiers = FileOpen(@WorkingDir & "\Sortie\SIRENS_" & $x & ".txt", 138)
            $i = 1
            $x += 1
        EndIf
    Next
WEnd
FileClose($Recherche)

Func Function($Var)
    Local $Data  = ""
    $Data = $Var * Random(1, 10, 1)
EndFunc

Share this post


Link to post
Share on other sites
Melba23

ATR,

Firstly, why do you even have a function for such a small code snippet? Just use:

FileWrite($Fichiers, $Var * Random(1, 10, 1))
Secondly, what exactly are you asking? To be able to simultaneously FileWrite multiple lines of the randomly multipled elements of the $Vars array? If so, then you cannot. :(

But what exactly asre you trying to do with this script? If we knew its purpose, we might be able to offer you a better way to go about it. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
ATR

In real, my function is longer. This function is for example.

I must read 500 files and I want use my function for the thirst file. And outside to wait the end of the frst file, use this function for the second file simultaneously

Share this post


Link to post
Share on other sites
Melba23

ATR,

Then you will need to start separate processes to run each instance of the function - not something I would want to consider given that you will doubtless need to recover some form of return value from each. :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
kylomas

---  deleted ---

This code makes zero sense to me

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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  

×