Seite 2 von 2

Verfasst: 15.04.2008 18:52
von Kiffi
Ironsmurf hat geschrieben:Das Beispiel funktioniert, kann man die Abfrage auch erreichen mit den normalen Input Befel ?
wie Du bei beiden Beispielen siehst: Nein.

Wieso?

Grüße ... Kiffi

Verfasst: 15.04.2008 19:04
von Ironsmurf
Es wäre schön, wenn ich die F-Tasten in eine Datenbank integrieren könnte,
z.B. F1 = Licht an ( bezieht sich auf die Relaiskarte ) oder F2 = starte Programm XYZ.
Das Programm funktioniert auch, leider bekomme ich das mit den F-Tasten nicht hin.

Code: Alles auswählen

Procedure Print_s(text.s)
CharToOem_(text.s,text.s)
PrintN( text.s)
EndProcedure

;################################################################

;Globaliere String$ 
Global Eingabe$ 
Procedure String(text$) 
  If FindString(Eingabe$, text$, 1) 
    ProcedureReturn 1 
  Else 
    ProcedureReturn 0 
  EndIf
EndProcedure

;################################################################



;################################################################

Structure Movie
           Code$
           Name$
           Star$
           Info$
           Regi$
           Jahr$
           Lang$
  EndStructure

;################################################################

Dim DVD.Movie(9999)

  DVD (0001) \ Code$ = "0001"
  DVD (0001) \ Name$ = "Cocktail"
  DVD (0001) \ Star$ = "Tom Cruise, Bryan Brown, Elisabeth Shue, Lisa Banes, Gina Gershon, Kelly Lynch, Laurence Luckinbill"
  DVD (0001) \ Info$ = "A001"
  DVD (0001) \ Regi$ = "Roger Donaldson"
  DVD (0001) \ Jahr$ = "1988"
  DVD (0001) \ Lang$ = "103"
  
OpenConsole()

ConsoleTitle ("MAX Butler") 

;Lampe einschalten
ConsoleColor(15,0)
PrintN("")
PrintN("W I L L K O M M E N")
PrintN("-------------------")
PrintN("")
Delay (1000)
ConsoleColor(12,0)
PrintN("Das Licht wird eingeschaltet.")
RunProgram ("SETRelay", "/device:InterfaceA /on:1", "", 2)
Delay (1000)

;Sound einschalten
PrintN("")
PrintN("Das Dolby Suround System wird eingeschaltet.")
PrintN("")
Delay (500)
Print_s("Bitte denken Sie an die Lautstärkeregelung.")
RunProgram ("SETRelay", "/device:InterfaceA /on:2", "", 2)
PrintN("")

Repeat

ConsoleColor(13,0)

Eingabe$=""

Eingabe$ = Input()

;################################################################

OemToChar_(Eingabe$,Eingabe$)

;################################################################

;Entfernt Space von Beginn & Ende des Strings 
Eingabe$ = Trim(Eingabe$)
   
;################################################################

;Konvertiert alle Grossbuchstaben in Kleinbuchstaben 
Eingabe$ = LCase(Eingabe$) 

;################################################################
;RELAIS schalten
;################################################################

;Relais 1 - Licht Computer
If Eingabe$ = ("licht1") : RunProgram ("SETRelay", "/device:InterfaceA  /on:1", "", 2)
ElseIf Eingabe$ = ("licht0") : RunProgram ("SETRelay", "/device:InterfaceA /off:1", "", 2)

;Relais 2 - Dolby Suround 5.1
ElseIf Eingabe$ = ("sound1") : RunProgram ("SETRelay", "/device:InterfaceA  /on:2", "", 2)
ElseIf Eingabe$ = ("sound0") : RunProgram ("SETRelay", "/device:InterfaceA /off:2", "", 2)
 Endif


;################################################################

;STARS & MOVIE - SEARCH
AA = 1
 SortStructuredArray(DVD(), 0, OffsetOf(Movie\Name$), #PB_Sort_String)
  PrintN("")
   For index = 1 To 9999
    AusgabeFilm$ = DVD(index)\Name$
     AusgabeProm$ = DVD(index)\Star$
      AusgabeRegi$ = DVD(index)\Regi$
      If FindString (LCase(AusgabeProm$),LCase(Eingabe$),1) Or FindString (LCase(AusgabeFilm$),LCase(Eingabe$),1) Or FindString (LCase(AusgabeRegi$),LCase(Eingabe$),1)
       
       ConsoleColor(15,0)
        Print ("Startnummer : ")
         ConsoleColor(08,0)
          Print (DVD(index)\Code$)
          
           ConsoleColor(15,0)
            Print (" Erschienen: ")
             ConsoleColor(08,0)
              Print (DVD(index)\Jahr$)
              
               ConsoleColor(15,0)
                Print (" Dauer: ")
                 ConsoleColor(08,0)
                  Print (DVD(index)\Lang$)
                   Print (" min.")    
           
                    ConsoleColor(15,0)
                     Print (" Info Film: ")
                      ConsoleColor(08,0)
                       Print (DVD(index)\Info$)
                       
                        ConsoleColor(15,0)
                         Print (" Regie: ")
                          ConsoleColor(08,0)
                           Print_s (DVD(index)\Regi$)
                           
                            ConsoleColor(15,0)
                             Print("Filmtitel   : ")
                              ConsoleColor(14,0)
                               Print_s (DVD(index)\Name$)
                               
                                ConsoleColor(15,0)
                                 Print("Schauspieler: ")
                                  ConsoleColor(10,0)
                                   Print_s (DVD(index)\Star$)
                                   
                                    AA = AA + 1
                                     PrintN("")
                                      If AA = 13
                                       ConsoleColor(08,0)
                                        Print_s("Bitte die Taste RETURN oder ENTER drücken")
                                         PrintN("")
                                          Pause$ = Input()
                                           AA = 1
                                            EndIf
                                             EndIf 
                                              Next   
                 
;################################################################
;START - MOVIES 
;################################################################     

 ConsoleColor(14,0)

;################################################################

;START RELAIS 8

;################################################################

;0001 ° Cocktail
 If String ("0001") And RE8 = 0
  Print_s("0001 ° Cocktail")
   Gosub StartRelaisAcht
    RunProgram("X:\0001 ° Cocktail.avi")

     ElseIf String ("0001") And RE8 = 1
       Print_s("0001 ° Cocktail")
        Gosub Start
         RunProgram("X:\0001 ° Cocktail.avi")
         
;################################################################

EndIf

;################################################################

ForEver

;################################################################
;################################################################

StartRelaisAcht:
 PrintN("")
  RunProgram ("SETRelay", "/device:InterfaceA /on:8", "", 2) : RE8 = 1
   ConsoleColor(12,0)
    RunProgram("D:\Max Butler\Koolplaya.exe")
     Print_s ("Der Film wird in 10 sec. gestartet")
      Delay(9000)
       PrintN("")
        Return
      
;################################################################
;################################################################

Start:
 PrintN("")
  Return

Verfasst: 15.04.2008 19:46
von Kiffi
Ironsmurf hat geschrieben:Das Programm funktioniert auch, leider bekomme ich das mit den F-Tasten nicht hin.
sorry, aber wo ist denn jetzt das konkrete Problem? Sowohl Fluid Byte als
auch ich haben Dir zwei funktionierende Beispiele genannt. Hast Du
Probleme, den Code in Dein Programm zu integrieren?

Grüße ... Kiffi

Verfasst: 15.04.2008 19:50
von Ironsmurf
ja, genau so ist es.