I have a bit of a learning disability. I'm looking for critiques on my project.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sashaatx
Posts: 333
Joined: 27 May 2021, 08:27
Contact:

I have a bit of a learning disability. I'm looking for critiques on my project.

Post by sashaatx » 30 Jul 2022, 07:19

I dont have an extensive background in coding, but have been using ahk for 5 years. Some foundational elements have been tough to grasp.

​

I have tried passing arrays, into return \[x,y,z\]

I have tried sending data to a log file

I use a lot of comma delimination, so I dont know which is better. Loop, parse, or instringsplit, or loop read.

I would love to lay out like 3 situations and just get someone to critique/shit on/share advicce. Thanks.


Sending FSRemove(storedget) to another file, getting an array, writing to text file, retrieving and inserting variables into html/javacsript

Code: Select all

    FSRemove(StoredGet) 
                html:=""
                delimiter := ","
                Loop, read, %LogGames%
                { 
                    if (A_LoopReadLine="") 
                        continue
                    else
                    {
                        Cell := StrSplit(A_LoopReadLine,delimiter)
                        curgame := Cell[2]
                        html=
                        (
                        <option value="%curgame%" id="myH2" name="game">%curgame%</option> 

                        %html%
                        )
                    } 
                } 
.///////////////////////////////

file 2 receiving funcction call

Code: Select all

        FSRemove(StoredGet)
        {
            Global 
            loopstore:=""
            Loop, Read, %LogGames%
            { 
                        CurrentLine:=A_LoopReadLine
                        If InStr(CurrentLine,"")
                            continue
                        If InStr(CurrentLine,StoredGet)
                        {
                            LineRead := StrSplit(CurrentLine,delimiter)   
                            GameUninstall:=LineRead[1]
                            john:=1
                        }

                        if (john!="1")
                        { 
                            loopstore= 
                            (
        %CurrentLine% 

        %loopstore%
        )
                        } 
                        john:=0
                    } 

        /* 

                word_array := StrSplit(A_LoopReadLine, delimiter) 
                string:=word_array[1]
                if instr(string,StoredGet)
                    continue
                if (string="")
                    continue
                else
                {
                    loopstore= 
                    (
        %A_LoopReadLine% 

        %loopstore%

        )
                }
            } 
                    */
            Templog := A_ScriptDir "\loggame1.txt"
            Filedelete, %Templog% 
            Fileappend, %loopstore%, %Templog% 
            Filemove, %Templog%, %LogGames%, 1
            Filedelete, %GamesUpdate% 
            Filemove, %GameUninstall%, %GamesUpdate%, 1
                }

Return to “Ask for Help (v1)”