Ich weiß es nicht auswendig, aber es kann sein, dass _ArrayAdd noch ein Element hinzufügt (Anzahl?)
Mach auf jeden Fall mal nach Zeile 3 ein _ArrayDisplay($filesArray) hin
Stimmt, Raupi hat natürlich Recht.
Beiträge von L3viathan
-
-
Auch ne Möglichkeit: Einen IE einbetten, eine temporäre HTML-Datei mit <marquee> erstellen

-
[autoit]
;by Moditpraxis
[/autoit]
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Sampler", 252, 97, 212, 124)
$Label1 = GUICtrlCreateLabel("Datei Verwalter", 0, 0, 248, 41)
GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Name:", 8, 56, 35, 17)
$Ordner = GUICtrlCreateInput("Ordner Name", 48, 56, 89, 21)
$Button1 = GUICtrlCreateButton("OK", 152, 56, 73, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
If Not FileExists("C:\Capture") Then DirCreate("C:\Capture")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Ordner
$Text=GUICtrlRead($Ordner)
FileWrite("C:\Capture\Capture.cfg", $Text)
EndSwitch
WEnd -
Logikproblem
[autoit]
Func fa($num,$faktor)
[/autoit]
MsgBox(0,$num,$faktor); dient nur zur kontrolle und zeigt das richtige an
$faktor = $faktor - 1
If $faktor = 1 Then Return $num
$num = $num * $faktor
Return fa($num,$faktor)
EndFunc
$n=4
$f=4
$p=fa($n,$f)
MsgBox(0,"Fakultät von: "&$n,$p)l
edit: Erläuterung:
Nur die innerste Funktion gibt "24" an die nächstaäußere Funktion zurück, diese gibt den Rückgabewert nicht weiter.
Deshalb muss da Return fa($num,$faktor) statt nur fa($num,$faktor) stehen.
-
Nachträglich: Alles gute!

-
Fehler behoben (siehe Edit)
-
Was ja wohl unnötig ist, wenn das Programm direkt beendet wird, oder?
-
Besser:
[autoit]GUICreate("Test",200,200)
[/autoit]
;Ctrls...
$dummyf5=GUICtrlCreateDummy()
dim $accel[1][2]=[[$dummyf5,"{F5}"]]
GUISetAccelerators($accel)
GUISetState()
While True
Switch GUIGetMsg()
Case $dummyf5
MsgBox(0,"","Funktion")
EndSwitch
WEnd
edit: Fehler behoben -
Na so ists doch auch gut

-
wenn schon mit AdLibRegister dann aber auch AdLibUnregister also die Schleife so:
Wozu?
-
Es geht einfacher:
[autoit]GUISetAccelerators
[/autoit] -
Gute Idee, würde auf jeden Fall mitmachen.
Soll es sozusagen einen Sharing-Ordner geben? Weil ich ja nicht umbedingt alle meine Skripte mit euch teilen möchte
-
Lilypond kenne ich, allerdings ist es ja ein Notensatzprogramm, kein Akkordsatzprogramm. Außerdem etwas umständlich zu bedienen.
-
Zum Testen kriegt ihr mal ne Textdatei von ultimate-guitar.com:
Spoiler anzeigen
Code
Alles anzeigenFmaj7 Em7 Hello Innocence Am G Fmaj7 Though it seems like we've been friends for years Em7 I'm finishing Am G/B Cm How I wish I had never begun Bb F Though it should be the last one Fmaj7/G Cm And it's dragging me down to my knees Cm/Bb Where I'm begging you please Fmaj7 G7/13 Let me go Fmaj7 G7/13 Don't you know C Gm I'm all over it now Eb F And I can't say how glad I am about that C Gm I'm all over it now Ab Cm7/G F7 Cause I worked and I cursed and I tried Ab Cm7/G F7 And I said I could change and I lied Ab Cm7/G F7 Well there's something still moves me inside // Fmaj7 Em7 She's a melody Am G Fmaj7 That I've tried to forget but I can't Em7 It still follows me Am G/B Cm When I wake in the dead of the night Bb F And I know that I can't find Fmaj7/G Cm That song going round in my head Cm/Bb Like the last things you said Fmaj7 G7/13 Please don't go Fmaj7 G7/13 You think I know C Gm I'm all over it now Eb F And I can't say how glad I am about that C Gm I'm all over it now Ab Cm7/G F7 Cause I worked and I cursed and I cried Ab Cm7/G F7 And I said I could change and I lied Ab Cm7/G F7 Well there's something still moves me inside Fmaj7 G No I won't come back Em7 Am7 No I won't come back Fmaj7 G No I won't come back Em7 Am7 No I won't come back Dm7/9/11 One Fmaj7/9 dark Am7 Cmaj7 Mor - ning Dm7/9/11 She left Fmaj7/9 without a Am7 Cmaj7 War - ning Dm7/9/11 And took Fmaj7/9 Am7 Cmaj7/9 Dm7/9 the red-eye back to London town // C Gm Eb F7 I'm all over it now // C Gm Eb F7 I'm all over it now // C Gm Eb F7 I'm all over it now C Gm Eb F7 I'm all over it now C Gm I'm all over it now Eb F And I can't say how glad I am about that C Gm I'm all over it now Ab Cm7/G F7 Cause I worked and I cursed and I tried Ab Cm7/G F7 And I said I would change but I lied Ab Cm7/G F7 F6 Well there's something still moves me inside // -
Ich präsentiere:
Chords v0.2
[Blockierte Grafik: http://www.abload.de/img/chordsuploada50q.png]
Man kann damit Akkorde im Text transponieren, oder die Auswahl. Die Öffnen- und Speicherfunktion ist einigermaßen ausgereift.
Bugs: Momentan klappt aus unerfindlichen Gründen das runtertransponieren nicht...
Außerdem funktioniert Reselektieren nach dem Transponieren nicht, obwohl eigentlich alle Parameter richtig sind...
Todo:Paralleltonart, AutoScroll (langsames runterscrollen), ...EDIT
ChordGUI.au3
[autoit]#cs
[/autoit] [autoit][/autoit] [autoit]
The following content is licensed under a CC 3.0 by-nc-sa license
In short, that means, that you are allowed to copy or modify the original file, if you don't do this commercially,
if you name the author ( L3viathan2142, http://twitter.com/L3viathan2142) and if you redistribute the modification under the
same attributions. You are never allowed to remove this comment.
License overview:
http://creativecommons.org/licenses/by-nc-sa/3.0/de/
Full license
http://creativecommons.org/licenses/by-nc-sa/3.0/de/legalcode
#ce
#include <Array.au3>
#include <GuiEdit.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include "_Chords.au3"
GLOBAL $savedName="",$savedVersion=""
$Form1 = GUICreate("Chords - Unbenannter Song", 700, 442)
$FileMenu=GUICtrlCreateMenu("&Datei")
$newitem = GUICtrlCreateMenuItem("Neu" & @TAB & "Strg+N", $filemenu)
$openitem = GUICtrlCreateMenuItem("Öffnen" & @TAB & "Strg+O", $filemenu)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
$helpmenu = GUICtrlCreateMenu("?")
$saveitem = GUICtrlCreateMenuItem("Speichern..." & @TAB & "Strg+S", $filemenu)
$infoitem = GUICtrlCreateMenuItem("Info", $helpmenu)
$exititem = GUICtrlCreateMenuItem("Beenden" & @TAB & "Alt+F4", $filemenu)
$Edit1 = GUICtrlCreateEdit("", 0, 0, 633, 420)
GUICtrlSetFont(-1,10,Default,Default,"Courier New")
GUICtrlSetData(-1,"")
GUICtrlSetBkColor(-1,0xffffff)
;Buttons:
$hTransplus=GUICtrlCreateButton("Transpose +1",633,0,67,67,$BS_ICON)
GUICtrlSetImage(-1, "plus1.ico",0,1)
$hTransminus=GUICtrlCreateButton("Transpose -1",633,67,67,67,$BS_ICON)
GUICtrlSetImage(-1, "minus1.ico",0,1)
GUICtrlCreateButton("Platzhalter",633,2*67,67,67,$BS_ICON)
GUICtrlCreateButton("Platzhalter",633,3*67,67,67,$BS_ICON)
GUICtrlCreateButton("Platzhalter",633,4*67,67,67,$BS_ICON)Dim $accel[3][2]=[["^n",$newitem],["^o",$openitem],["^s",$saveitem]]
[/autoit] [autoit][/autoit] [autoit]
GUISetAccelerators($accel)
GUISetState(@SW_SHOW)While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $newitem
_new()
Case $openitem
_open()
Case $saveitem
_save()
Case $exititem, $GUI_EVENT_CLOSE
If _new() Then Exit
Case $infoitem
_info()
Case $hTransplus
_transPLUS()
Case $hTransminus
_transMINUS()
EndSwitch
WEnd
Func _new()
If $savedVersion <> GUICtrlRead($Edit1) Then
$question=MsgBox(32+3,"Chords","Das Dokument hat ungespeicherte Änderungen. Möchten Sie speichern?")
Switch $question
Case 2
Return False
Case 6
If not _save() Then Return False
Case 7
;do nothing
EndSwitch
EndIf
GUICtrlSetData($Edit1,"")
$savedVersion=""
Return True
EndFunc
Func _save()
$ask=FileSaveDialog("Datei speichern...",@WorkingDir,"Textdateien (*.txt)|Alle Dateien (*.txt)",16,$savedName)
If not @error Then
$hFile=FileOpen($ask,2)
FileWrite($hFile,GUICtrlRead($Edit1))
FileClose($hFile)
$savedName=$ask
WinSetTitle("Chords","","Chords - " & $savedName)
Else
Return False
EndIf
EndFunc
Func _open()
$ask=FileOpenDialog("Datei öffnen...",@WorkingDir,"Textdateien (*.txt)|Alle Dateien (*.txt)",3)
If @error Then Return False
If not _new() Then Return False
$hFile=FileOpen($ask,0)
GUICtrlSetData($Edit1,FileRead($hFile))
FileClose($hFile)
$savedName=$ask
WinSetTitle("Chords","","Chords - " & $savedName)
EndFunc
Func _info()
MsgBox(64,"Chords","Chords - ein simples Akkordprogramm" & @CRLF & @CRLF & "Ein Programm von L3viathan2142" & @CRLF & "(c) 2010. Alle Rechte vorbehalten.")
EndFunc
Func _transPLUS()
$aTmp=_GUICtrlEdit_GetSel($Edit1)
$read=GUICtrlRead($Edit1)
If $aTmp[0] = $aTmp[1] Then Return GUICtrlSetData($Edit1,_TextTranspose($read,1))
$text=StringTrimLeft(StringLeft($read,$aTmp[1]),$aTmp[0])
$newText=_TextTranspose($text,1)
$newlen=StringLen($newText)
GUICtrlSetData($Edit1,StringLeft($read,$aTmp[0]) & $newText & StringTrimLeft($read,$aTmp[1]))
_GUICtrlEdit_SetSel($Edit1,$aTmp[0],$aTmp[0]+$newlen);not working
EndFunc
Func _transMINUS()
$aTmp=_GUICtrlEdit_GetSel($Edit1)
$read=GUICtrlRead($Edit1)
If $aTmp[0] = $aTmp[1] Then Return GUICtrlSetData($Edit1,_TextTranspose($read,-1))
$text=StringTrimLeft(StringLeft($read,$aTmp[1]),$aTmp[0])
$newText=_TextTranspose($text,-1)
$newlen=StringLen($newText)
GUICtrlSetData($Edit1,StringLeft($read,$aTmp[0]) & $newText & StringTrimLeft($read,$aTmp[1]))
_GUICtrlEdit_SetSel($Edit1,$aTmp[0],$aTmp[0]+$newlen);not working
EndFunc
;#TODO:
#cs
AutoScroll
Transpose+1/-1
Print (HTML <b>)
Parallele Moll/Dur-Tonart
#ce_Chords.au3
[autoit]#cs
[/autoit]
The following content is licensed under a CC 3.0 by-nc-sa license
In short, that means, that you are allowed to copy or modify the original file, if you don't do this commercially,
if you name the author ( L3viathan2142, http://twitter.com/L3viathan2142) and if you redistribute the modification under the
same attributions. You are never allowed to remove this comment.
License overview:
http://creativecommons.org/licenses/by-nc-sa/3.0/de/
Full license
http://creativecommons.org/licenses/by-nc-sa/3.0/de/legalcode
#ce
#include <Array.au3>
;Schreibweise:
#cs
Großbuchstabe A-G
optional "m" für moll
optional Zahlen
optinal "/" & A-G
#ce
;~ $_REGEXP_CHORD="([A-G](#|b){0,1}m{0,1}\d*(/[A-G]){0,1})"
$_REGEXP_CHORD="\b(?:[A-G](?:#|b)?m?\d*[^\w ]?\b)\b"
$_TONE_C=0
$_TONE_Db=1
$_TONE_D=2
$_TONE_Eb=3
$_TONE_E=4
$_TONE_F=5
$_TONE_Gb=6
$_TONE_G=7
$_TONE_Ab=8
$_TONE_A=9
$_TONE_Bb=10
$_TONE_B=11
Func _isChord($sChord)
Return StringRegExp($sChord,$_REGEXP_CHORD,0)
EndFunc
Func _ChordTranspose($sChord,$iTones)
;$iTones= +- 11
$firstTone=_ChordGetBasicTone($sChord,0)
$append=_ChordGetAppendix($sChord)
$secondTone=Mod($firstTone+$iTones+12,12)
Return _NumberToLetter($secondTone) & $append
EndFunc
Func _ChordGetBasicTone($sChord, $iFlag=0);iFlag: 0=zahl, 1=Buchstabe
If not _isChord($sChord) Then
SetError(1);No Chord
Return
EndIf
$matches=StringRegExp($sChord,"^[A-Z](#|b){0,1}",2)
$sLetter=$matches[0]
If $iFlag=1 Then Return $sLetter
Return _LetterToNumber($sLetter)
EndFunc
Func _LetterToNumber($sLetter)
If Not StringRegExp($sLetter,"^[A-Z](#|b){0,1}$",0) Then
SetError(1);No Letter
Return
EndIf
Switch $sLetter
Case "C"
Return 0
Case "Db","C#"
Return 1
Case "D"
Return 2
Case "Eb","D#"
Return 3
Case "E"
Return 4
Case "F"
Return 5
Case "Gb","F#"
Return 6
Case "G"
Return 7
Case "Ab","G#"
Return 8
Case "A"
Return 9
Case "Bb","A#"
Return 10
Case "B"
Return 11
EndSwitch
EndFunc
Func _NumberToLetter($iNumber)
If Not isNumber($iNumber) Then
SetError(1);No Number
Return
EndIf
Switch $iNumber
Case 0
Return "C"
Case 1
Return "Db"
Case 2
Return "D"
Case 3
Return "Eb"
Case 4
Return "E"
Case 5
Return "F"
Case 6
Return "Gb"
Case 7
Return "G"
Case 8
Return "Ab"
Case 9
Return "A"
Case 10
Return "Bb"
Case 11
Return "B"
EndSwitch
EndFunc
Func _ChordGetAppendix($sChord)
$matches=StringRegExp($sChord,"m{0,1}\d*(/[A-G]){0,1}$",2)
Return $matches[0]
EndFunc
Func _TextTranspose($sText,$iTones)
$aTmp = StringRegExp($sText,$_REGEXP_CHORD,3)
For $i=0 To UBound($aTmp)-1
$tmp=_ChordTranspose($aTmp[$i],$iTones)
$TempPattern="\b("&$aTmp[$i]&")\b"; Match nur innerhalb der Wortgenze
$sText=StringRegExpReplace($sText,$TempPattern,$tmp)
Next
Return StringReplace($sText,"q@qq","")
EndFunc
edit: Problem 1 (-1 transponieren) gelöst -
WOW, danke
Super, dann klappt das jetzt alles, dann kann ich mich jetzt der GUI widmen
-
Nein, ich wollte prüfen, OB das ein Akkord ist. Klappt aber jetzt, siehe Edit.
-
Such mal nach "progress marquee"
-
Schnitzel: Dein pattern nimmt offenbar garnichts, da das Resultat nicht vom Ausgangszustand abweicht.
SEuBo: Dein Pattern bewirkt das selbe wie mein zweites. -
Zitat
Bb7 -> _ChordTranspose("B",7) ?
Nein.
Bb7 -> _ChordTranspose("A7",1).
Aber dieses Problem hier ist einigermaßen gelöst, ich komme nur hier absolut nicht weiter:
https://autoit.de/index.php?page=Thread&threadID=17085