Oliver122

Verfasste Forenbeiträge

Ansicht von 15 Beiträgen - 31 bis 45 (von insgesamt 98)
  • Autor
    Beiträge
  • als Antwort auf: Zeilen nach oben schieben #27076
    Oliver122
    Teilnehmer

      Eine Sache habe ich noch vergessen. Alle Skripte sind auf der Card, mit Ausnahme der in den beiden btn.
      Das wird bei einem nächsten Programm sicher besser werden. Da wird mehr Skript im Stack sein. Ich Stack befindet sich z.Z. Nur die Speichergeschichte, welche für Card Sparen noch nicht existiert.

      als Antwort auf: Zeilen nach oben schieben #27066
      Oliver122
      Teilnehmer

        Hallo Klaus,

        hier das ges. Skript:

        Skript Card Sparen; Open Card
        ###########################################################

        #### Ich denke deine Erklärungen hierzu habe ich verstanden.
        #### Dasganze wird aber noch angepasst. Das kommt später dran

        global s, oben2, posi, lnr, tSkript3, tZahl, zz, grplist, oben3
        
        on openCard
           if the environment is "mobile" then
              put specialFolderPath("engine") into programmPfad
           else
              put the filename of this Stack into programmPfad
              set the itemDelimiter to "/"
              delete the last item of programmPfad
           end if
           if there is not a folder (specialFolderPath("documents")&"/Speicherdatenhaus/SVar" ) then
              create folder (specialFolderPath("documents")&"/Speicherdatenhaus/SVar")
           else
              
           end if
           put programmPfad &"/splash.livecode" into tZieldatei
           start using stack tZieldatei
        end openCard
        ######################################################################################
        ## Positionieren erzeugt nur eine Variable posi, in welcher in jeder line der Wert für top steht.
        ## Wenn man den btn New Line ( Skript kommt noch) klickt und Silber, im Dropdown Menü wählt, wird 
        ## eine Line aus mehreren Felder erzeugt. Das erste endhählt die LNr., die automatisch eingetragen
        ## werden soll und das letzte ist ein btn, der die grp "dele" öffnet. Ein fld, mit zwei btn, abbrechen und
        ## ok. Bein klick auf ok, wird die Zeile gelöscht und alle darunterliegenden sollten nachrücken.
        ## In den fld dazwischen können Eintragungen gemacht werden.
        
        on posisetzen
           if posi = empty then
              put empty into lnr
              put 0 into oben2
              put 0 into s
              put empty into grplist
              put 0 into tZahl
              repeat with y = 1000000 down to 225 step - 25
                 put y & return after posi
              end repeat
              sort lines of posi numeric
              //speichern
           end if
              posisetzen2
        end posisetzen
        
        ###############################################################################
        ## Die erstellte grp heißt grp ("block"&s). Die Variable s wir immer um 1 erhöht, damit sie alle
        ## einen unterschiedlichen Namen haben. line 1 von posi, wird in oben2 kopiert und bildet den Wert für top.
        ## Damit die nächste line nicht an der gleichen Stelle ist, wird line 1 gelöscht, sodass die nächste
        ## line um 25 erhöht ist. Wenn eine line gelöscht wird, wird der top Wert an posi zurückgegeben und
        ## posi numerisch geordnet. Das funktioniert alles. Nur das Aufrücken nicht. 
        ## // speichern ist nur Platzhalter und kommt noch.
        
        on posisetzen2
           add 1 to s 
           put line 1 of posi into oben2
           delete line 1 of posi
           //speichern
           silberline
        end posisetzen2
        
        // Spalten erstellen
        ###########################################################################
        ## Hier wird die line, inkl. Löschen btn (dele1) erzeugt.
        ## tZahl gibt an wie viele dieser lines existieren. Beim Löschen also auch subtract 1
        ## del2 wird ausgelöst
        
        on silberline
           lock screen
           set the label of btn "Münzen2" to "New Line"
           
           create grp ("block"&s) in grp "GoSi"
           put the short name of grp ("block"&s) of grp "GoSi" & return after grplist
           
           create fld "Nr" in grp ("block"&s) of grp "GoSi"
           set the width of fld "Nr" of grp ("block"&s)  to 30
           set the height of fld "Nr" of grp ("block"&s)  to 25
           set the left of fld "Nr" of grp ("block"&s)  to 53
           set the locktext of fld "Nr" of grp ("block"&s) to true
           
           create fld "edelme" in grp ("block"&s) of grp "GoSi"
           set the width of fld "edelme" of grp ("block"&s)  to 250
           set the height of fld "edelme" of grp ("block"&s)  to 25
           set the left of fld "edelme" of grp ("block"&s) to 83
           
           create fld "kafda" in grp ("block"&s) of grp "GoSi"
           set the width of fld "kafda" of grp ("block"&s)  to 100
           set the height of fld "kafda" of grp ("block"&s)  to 25
           set the left of fld "kafda" of grp ("block"&s)  to 333 
           
           create fld "kafpr" in grp ("block"&s) of grp "GoSi"
           set the width of fld "kafpr" of grp ("block"&s)  to 100
           set the height of fld "kafpr" of grp ("block"&s)  to 25
           set the left of fld "kafpr" of grp ("block"&s)  to 433
           
           create fld "anz" in grp ("block"&s) of grp "GoSi"
           set the width of fld "anz" of grp ("block"&s)  to 100
           set the height of fld "anz" of grp ("block"&s)  to 25
           set the left of fld "anz" of grp ("block"&s)  to 533
           
           create fld "gew" in grp ("block"&s) of grp "GoSi"
           set the width of fld "gew" of grp ("block"&s)  to 100
           set the height of fld "gew" of grp ("block"&s)  to 25
           set the left of fld "gew" of grp ("block"&s)  to 633
           
           create fld "uz1" in grp ("block"&s) of grp "GoSi"
           set the width of fld "uz1" of grp ("block"&s)  to 50
           set the height of fld "uz1" of grp ("block"&s)  to 25
           set the left of fld "uz1" of grp ("block"&s)  to 733
           
           create btn "del1" in grp ("block"&s) of grp "GoSi"
           set the width of btn "del1"  of grp ("block"&s)  to 10
           set the height of btn "del1"  of grp ("block"&s)  to 25
           set the left of btn "del1"  of grp ("block"&s)  to 783
           set the label of btn "del1" of grp ("block"&s) to "x"
           put "global zz, posi" & CR & "on mouseUp" & CR & "put the top of the owner of me & return after posi" & CR & "put the short name of the owner of me into zz" & CR & "del1" & CR & "end mouseUp" into tSkript3
           set the script of btn "del1" of grp ("block"&s)  to tSkript3
           
           set the top of grp ("block"&s) of grp "GoSi" to oben2
           add 1 to tZahl
           del2
           unlock screen
        end silberline
        ##################################################################################
        
        ## del1 öfnet grp dele, wenn der btn "del1" benutzt wird um eine line zu löschen.
        
        on del1
           sort lines of posi numeric
           show grp "dele"
        end del1
        #############################################################################
        ## Der top Wert, der gelöschten line, wird in oben2 kopiert und alle lines, welche einen
        ## höheren Topwert haben, sollen aufrücken. Die anderen liegen ja bereits drüber.
        ## posi wird neu erzeugt und soviele lines of posi gelöscht, wie es grp ("block"&s) gibt
        ## damit es wieder zusammen passt und eine mögliche neue grp genau unter der letzten erzeugt wird.
        
        on del3
           // Höhen anpassen
        repeat tZahl
              if there is a grp ("block"&s) and the top of grp ("block"&s) > oben2 then
                 put the top of grp ("block"&s) into oben3
                 set the top of grp ("block"&s) to oben3 -25 
              end if
        end repeat
           put empty into posi
           repeat with y = 1000000 down to 225 step - 25
              put y & return after posi
           end repeat
           sort lines of posi numeric
           delete line 1 to tZahl of posi
        end del3
        ##################################################################################
        ## del2 packt die laufende Nr. in das erste Feld, jeder line bzw. grp ("block"&s)
              
        on del2
           // nummerieren
           put empty into lnr
           if there is a grp ("block"&s) then
              repeat with g = 1 to tZahl
                 put g & return  after lnr
              end repeat
              sort lines of lnr numeric
           end if
           if there is a grp ("block"&s) then
              repeat for each line c in lnr
                 put line c of lnr into fld "Nr" of grp ("block"&s)
              end repeat
           end if
        end del2

        ##############################################################################
        ## Dies ist das Skript für den btn, mit welchen ich die lines block… erzeugen kann.
        ## Die Auswahl Silber ist das was ich gerade schreibe, Gold, was goldline auslöst
        ## kommt noch, ist aber ähnlich.

        global menue
        on menuPick 
           put the label of btn "münzen2"into menue
           if menue = "Silber" then
              posisetzen
           else
              goldline
           end if
        end menuPick

        #############################################################################
        ## Wenn der btn dele1 betätigt wird, öffnet sich die grp dele. Drückt man auf ok,
        ## wird das o.a. Skript ausgelöst und grp block…. gelöscht.
        ## zz wird gefüllt, wenn man auf dem btn dele1 drückt, druch den Skriptbefehl
        ## put the short name of the owner of me into zz. Wie gesagt das funktioniert auch.
        ## Nur rücken die lines grp block… nicht auf, jedenfalls nicht immer, nur selten.
        ## Drückt man auf Abbrechen wir natürlich nur hide grp „dele“ ausgelöst.
        ## Das steht im btn Abbrechen.

        global oben2,zz, tZahl, grplist
        
        on mouseUp
           put the top of grp zz into oben2
           delete grp zz
           subtract 1 from tZahl
           del3
           del2
           hide grp "dele"
        end mouseUp

        #############################################################

        So das müsste eigentlich alles sein. Ich hoffe es ist vollständig und verständlich.

        Danke schonmal vorab.

        Gruß

        Oliver

        als Antwort auf: Zeilen nach oben schieben #27041
        Oliver122
        Teilnehmer

          Wenn der btn del1 erzeugt wird.
          Dieser schreibt den Short name, der grp, bei Benutzung
          in die Variable zz.

          als Antwort auf: Zeilen nach oben schieben #27033
          Oliver122
          Teilnehmer

            Hallo Klaus,

            das Skript zum Löschen ist:

            global oben2,zz, tZahl, grplist
            
            on mouseUp
               put the top of grp zz into oben2
               delete grp zz
               subtract 1 from tZahl
               del3
               del2
               hide grp "dele"
            end mouseUp

            Dies wird über

            on del1
               sort lines of posi numeric
               show grp "dele"
            end del1

            aufgerufen. Beim Druck auf ok, wird dann die Zeile gelöscht.

            Danke für deine Hilfe.

            als Antwort auf: Zeilen nach oben schieben #27019
            Oliver122
            Teilnehmer

              Hallo Klaus,

              ah ok das stelle ich nachher mit einigen Erläuterungen ein.

              Danke

              als Antwort auf: Zeilen nach oben schieben #27014
              Oliver122
              Teilnehmer

                Hallo Klaus,

                kannst du schon was über den Loop sagen?

                Danke im Voraus

                Oliver

                als Antwort auf: Zeilen nach oben schieben #26952
                Oliver122
                Teilnehmer

                  Hallo Klaus,

                  hier das ges. Skript:

                  global s, oben2, posi, lnr, tSkript3, tZahl, zz, grplist, oben3
                  
                  on openCard
                     if the environment is "mobile" then
                        put specialFolderPath("engine") into programmPfad
                     else
                        put the filename of this Stack into programmPfad
                        set the itemDelimiter to "/"
                        delete the last item of programmPfad
                     end if
                     if there is not a folder (specialFolderPath("documents")&"/Speicherdatenhaus/SVar" ) then
                        create folder (specialFolderPath("documents")&"/Speicherdatenhaus/SVar")
                     else
                        
                     end if
                     put programmPfad &"/splash.livecode" into tZieldatei
                     start using stack tZieldatei
                  end openCard
                  
                  on posisetzen
                     if posi = empty then
                        put empty into lnr
                        put 0 into oben2
                        put 0 into s
                        put empty into grplist
                        put 0 into tZahl
                        repeat with y = 1000000 down to 225 step - 25
                           put y & return after posi
                        end repeat
                        sort lines of posi numeric
                        //speichern
                        posisetzen2
                     else
                        posisetzen2
                     end if
                  end posisetzen
                  
                  on posisetzen2
                     add 1 to s 
                     put line 1 of posi into oben2
                     delete line 1 of posi
                     //speichern
                     silberline
                  end posisetzen2
                  
                  // Spalten erstellen
                  
                  on silberline
                     lock screen
                     set the label of btn "Münzen2" to "New Line"
                     
                     create grp ("block"&s) in grp "GoSi"
                     put the short name of grp ("block"&s) of grp "GoSi" & return after grplist
                     
                     create fld "Nr" in grp ("block"&s) of grp "GoSi"
                     set the width of fld "Nr" of grp ("block"&s)  to 30
                     set the height of fld "Nr" of grp ("block"&s)  to 25
                     set the left of fld "Nr" of grp ("block"&s)  to 53
                     set the locktext of fld "Nr" of grp ("block"&s) to true
                     
                     create fld "edelme" in grp ("block"&s) of grp "GoSi"
                     set the width of fld "edelme" of grp ("block"&s)  to 250
                     set the height of fld "edelme" of grp ("block"&s)  to 25
                     set the left of fld "edelme" of grp ("block"&s) to 83
                     
                     create fld "kafda" in grp ("block"&s) of grp "GoSi"
                     set the width of fld "kafda" of grp ("block"&s)  to 100
                     set the height of fld "kafda" of grp ("block"&s)  to 25
                     set the left of fld "kafda" of grp ("block"&s)  to 333 
                     
                     create fld "kafpr" in grp ("block"&s) of grp "GoSi"
                     set the width of fld "kafpr" of grp ("block"&s)  to 100
                     set the height of fld "kafpr" of grp ("block"&s)  to 25
                     set the left of fld "kafpr" of grp ("block"&s)  to 433
                     
                     create fld "anz" in grp ("block"&s) of grp "GoSi"
                     set the width of fld "anz" of grp ("block"&s)  to 100
                     set the height of fld "anz" of grp ("block"&s)  to 25
                     set the left of fld "anz" of grp ("block"&s)  to 533
                     
                     create fld "gew" in grp ("block"&s) of grp "GoSi"
                     set the width of fld "gew" of grp ("block"&s)  to 100
                     set the height of fld "gew" of grp ("block"&s)  to 25
                     set the left of fld "gew" of grp ("block"&s)  to 633
                     
                     create fld "uz1" in grp ("block"&s) of grp "GoSi"
                     set the width of fld "uz1" of grp ("block"&s)  to 50
                     set the height of fld "uz1" of grp ("block"&s)  to 25
                     set the left of fld "uz1" of grp ("block"&s)  to 733
                     
                     create btn "del1" in grp ("block"&s) of grp "GoSi"
                     set the width of btn "del1"  of grp ("block"&s)  to 10
                     set the height of btn "del1"  of grp ("block"&s)  to 25
                     set the left of btn "del1"  of grp ("block"&s)  to 783
                     set the label of btn "del1" of grp ("block"&s) to "x"
                     put "global zz, posi" & CR & "on mouseUp" & CR & "put the top of the owner of me & return after posi" & CR & "put the short name of the owner of me into zz" & CR & "del1" & CR & "end mouseUp" into tSkript3
                     set the script of btn "del1" of grp ("block"&s)  to tSkript3
                     
                     set the top of grp ("block"&s) of grp "GoSi" to oben2
                     add 1 to tZahl
                     del2
                     unlock screen
                  end silberline
                  
                  on del1
                     sort lines of posi numeric
                     show grp "dele"
                  end del1
                  
                  on del3
                     // Höhen anpassen
                  repeat tZahl
                        if there is a grp ("block"&s) and the top of grp ("block"&s) > oben2 then
                           put the top of grp ("block"&s) into oben3
                           set the top of grp ("block"&s) to oben3 -25 
                        end if
                  end repeat
                     put empty into posi
                     repeat with y = 1000000 down to 225 step - 25
                        put y & return after posi
                     end repeat
                     sort lines of posi numeric
                     delete line 1 to tZahl of posi
                  end del3
                        
                  on del2
                     // nummerieren
                     put empty into lnr
                     if there is a grp ("block"&s) then
                        repeat with g = 1 to tZahl
                           put g & return  after lnr
                        end repeat
                        sort lines of lnr numeric
                     end if
                     if there is a grp ("block"&s) then
                        repeat for each line c in lnr
                           put line c of lnr into fld "Nr" of grp ("block"&s)
                        end repeat
                     end if
                  end del2

                  Wenn man auf den Löschen btn del1 drückt, wird von tZahl eins abgezogen.
                  Durch btn del1 wird die Zeile gelöscht und dann del3 und dann del2 ausgelöst.

                  als Antwort auf: Kreierte btn speichern #26494
                  Oliver122
                  Teilnehmer

                    Hi Klaus,

                    hat ein bisschen gedauert. Jetzt ist das Problem endlich gelöst.
                    Danke für deine Hilfe.

                    Gruß Oliver

                    als Antwort auf: Stacks speichern in Standalones #25925
                    Oliver122
                    Teilnehmer

                      Wie kommt es zu der Meldung?
                      Ich müsste es eigentlich jetzt, so wie in deiner Anleitung haben.

                      Danke im Voraus

                      Gruß
                      Oliver

                      als Antwort auf: Stacks speichern in Standalones #25924
                      Oliver122
                      Teilnehmer

                        Hallo Klaus,

                        ich kam noch nicht dazu es richtig auszuprobieren. Ich habe aber immer eine Fehlermeldung, die ich nicht verstehe. Auch jetzt wo der splash stack eigenständig ist.

                        Die Fehlermeldung:
                        stack „splash“: execution error at line 20 (Handler: error in statement), char 1

                        Egal ob ich es so schreiber:

                        on openStack
                         
                           put the filename of this Stack into tZielordner
                           set the itemDelimiter to "/"
                           delete the last item of tZielordner
                           
                           put "/Haushaltsbuch" after tZielordner
                           if there is not a folder tZielordner then
                              create folder tZielordner
                           end if
                           put tZielordner & "/speicherbar.livecode" into tZieldatei
                           put specialfolderpath("resorces") & "/speicherbar.livecode" into tQuellDatei
                           if there is not a file tZieldatei then
                              put url("binfile:" & tQuellDatei) into url("binfile:" & tZieldatei)
                           end if
                           wait 2 secs
                           start using stack "splash"
                           hide stack "splash"
                           go stack  tZieldatei
                        end openStack

                        oder so:

                        on openStack
                           put specialfolderpath("support") into tZielordner 
                           put "/Haushaltsbuch" after tZielordner
                           if there is not a folder tZielordner then
                              create folder tZielordner
                           end if
                           put tZielordner & "/speicherbar.livecode" into tZieldatei
                           put specialfolderpath("resorces") & "/speicherbar.livecode" into tQuellDatei
                           if there is not a file tZieldatei then
                              put url("binfile:" & tQuellDatei) into url("binfile:" & tZieldatei)
                           end if
                           wait 2 secs
                           start using stack "splash"
                           hide stack "splash"
                           go stack  tZieldatei
                        end openStack
                        als Antwort auf: Stacks speichern in Standalones #25898
                        Oliver122
                        Teilnehmer

                          Hallo Klaus,

                          ich habe es für Windows gemacht und habe auch kein mac.
                          Es war ursprünglich so wie du es beschrieben hast, aber jetzt ist es anders, weil ich andere Sachen probiert habe.

                          Ergebnis ist aber immer das gleiche. In der standhalten Version ist alles weg, sobald das Programm geschlossen wird.

                          Danke für deine Hilfe. Ich schicke dir gleich die Mail

                          als Antwort auf: Stacks speichern in Standalones #25894
                          Oliver122
                          Teilnehmer

                            Hallo Klaus,

                            ich habe es genau so versucht und noch alles mögliche andere. Ist es für dich ok, wenn ich die das Programm schicke, du änderst es so dass es funktioniert und ich versuche es dann zu verstehen?
                            Ich bekomme es leider nicht hin und will aber auch nicht alles hinschmeißen, wegen dieses Problems.

                            als Antwort auf: Kreierte btn speichern #23738
                            Oliver122
                            Teilnehmer

                              Hallo Klaus,

                              irgendwie komme ich nicht weiter.
                              Ich habe dir das Speichertest-Programm mal per Mail geschickt.

                              Vielleicht komme ich ja so weiter.
                              Ich wäre dir wirklich sehr dankbar, wenn du dir das mal anschaust.

                              Danke im Voraus.

                              als Antwort auf: Kreierte btn speichern #23438
                              Oliver122
                              Teilnehmer

                                Hallo Klaus,

                                danke für deine Hilfe.
                                Zu der Frage was ich machen möchte:

                                Es geht darum, dass die über den „create“ btn erstellten button, in der standalone Version gespeichert werden.
                                Diese verschwinden nämlich immer, wenn das Programm geschlossen wird.

                                Wenn es dazu nötig ist eine card zu kopieren, dann ist das wohl der richtige Weg, aber bisher klappt es nicht.
                                Wenn ich nach dem Erstellen auf den meinen save btn Drücke, wird auch eine Datei ttest.livecode erstellt.
                                Wenn ich dann das Programm schließe und wieder öffne, ist der, über den „create“ btn erstellte button, wieder verschwunden. Aber genau der soll ja gespeichert werden.

                                als Antwort auf: Kreierte btn speichern #23424
                                Oliver122
                                Teilnehmer

                                  Hallo zusammen,

                                  um das ganze zu vereinfachen, habe ich ein kleines Testprogramm gebaut. Dort kann man über einen create Button, einen anderen erstellen und ihn dann speichern.

                                  Ich bekomme es aber nicht hin.

                                  gespeichert wird mit folgendem code:

                                  on mouseUp
                                     if there is a folder (specialFolderPath("documents")&"/speicherdatenhaus/hallo") then
                                        hall
                                   else
                                     create folder (specialFolderPath("documents")&"/speicherdatenhaus/hallo")
                                     hall
                                     end if
                                  end mouseUp
                                  
                                  on hall
                                     if there is not a stack "skard" then
                                        create invisible stack "skard"
                                        end if
                                        copy this card to  stack "skard"
                                        save  the  stack "skard" as url "file:"&specialFolderPath("documents")&"/speicherdatenhaus/hallo/ttest.livecode"
                                     end hall

                                  geladen mit:

                                  on openStack
                                     if the environment is "mobile" then
                                        put specialFolderPath("engine") into programmPfad
                                     else
                                        put the filename of this Stack into programmPfad
                                        set the itemDelimiter to "/"
                                        delete the last item of programmPfad
                                     end if
                                     if there is a file specialFolderPath("documents")&"/speicherdatenhaus/hallo/ttest.livecode" then
                                     go invisible stack "skard"
                                     copy stack "skard" url ("file:"&specialFolderPath("documents")&"/speicherdatenhaus/hallo/ttest.livecode") to stack "Untiteled1"
                                     end if
                                  end openStack

                                  Wenn der Stack geöffnet wird, ist der Button, in der Standaloneversion aber wieder weg.

                                  Könnt ihr mir bitte nochmal weiterhelfen?

                                  Danke im Voraus.

                                Ansicht von 15 Beiträgen - 31 bis 45 (von insgesamt 98)