Template:Property Summary: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 12: Line 12:
{{#if:{{{4|}}}|{{Pipe}}- style="background-color:#CC99FF;"
{{#if:{{{4|}}}|{{Pipe}}- style="background-color:#CC99FF;"
{{Pipe}} '''Database Table'''
{{Pipe}} '''Database Table'''
{{Pipe}} style="background-color:#CC99FF;" align="center" {{Pipe}} [[{{{4|}}} table {{Pipe}} {{{4|}}}]]
{{Pipe}} style="background-color:#CC99FF;" align="center" {{Pipe}} {{Multiple Tables|{{{4|}}}}}
{{Pipe}}- style="background-color:#CC99FF;" align="center"
{{Pipe}}- style="background-color:#CC99FF;" align="center"
{{Pipe}} ''Field Name''
{{Pipe}} ''Field Name''
{{Pipe}} style="background-color:#CC99FF;" align="center" {{Pipe}} [[{{{4|}}} table#{{{5}}} {{Pipe}} {{{5|}}}]]
{{Pipe}} style="background-color:#CC99FF;" align="center" {{Pipe}} {{#if:{{Multiple Tables|{{{5|}}}}}|[[{{{4|}}} table#{{{5}}} {{Pipe}} {{{5|}}}]]}}
{{Pipe}}- style="background-color:#CC99FF;" align="center"
{{Pipe}}- style="background-color:#CC99FF;" align="center"
{{Pipe}} ''Field Type''
{{Pipe}} ''Field Type''
Line 31: Line 31:
{{Pipe}} '''Members'''
{{Pipe}} '''Members'''
{{Pipe}} style="background-color:#ddd;" align="center" {{Pipe}} [[SDB{{{2|}}}]] | {{Pipe}}- style="background-color:#ddd;"}}
{{Pipe}} style="background-color:#ddd;" align="center" {{Pipe}} [[SDB{{{2|}}}]] | {{Pipe}}- style="background-color:#ddd;"}}
{{#ifexist:SDB{{{2|}}}List|{{Pipe}}- style="background-color:#ddd;"
{{Pipe}} '''Members'''
{{Pipe}} style="background-color:#ddd;" align="center" {{Pipe}} [[SDB{{{2|}}}List]] | {{Pipe}}- style="background-color:#ddd;"}}
|}
|}
 
{{#ifeq:{{{3|-}}}|Method||
 
 
===Example Code===
===Example Code===
'
{{Example Code|{{{1|-}}}|{{{2|-}}}|{{{3|-}}}|{{{4|-}}}|{{{5|-}}}|{{{6|-}}}|{{{7|-}}}|{{{8|-}}}|{{{9|-}}}}}}}
' MediaMonkey Script
<noinclude>[[Category:Template]]</noinclude>
'
' NAME: WikiSample.vbs
'
' Template Author: MoDementia
' Generated by MMWiki page {{PAGENAME}}
' DATE :  03:51, 7 April 2008 (EDT)
'
'Sample of Scripting Code for inclusion into MMWiki pages
'A working script to show database results using various selection methods
'
'MediaMonkey\Scripts\Scripts.in entry
'
'[WikiSample]
'Filename=WikiSample.vbs
'Procname=WikiSample
'Order=99
'DisplayName=WikiSample
'Description=Displays the raw database value of the MMWikipage item
'Language=VBScript
'ScriptType=0
Sub WikiSample
  Dim SelectMethod, WaterlooSongID, {{{3|-}}}New{{{2|-}}}
  Dim SQLString                                                            'SelectMethod 3
  Dim objSongList                                                          'SelectMethod 2
  SelectMethod = 1
  ' SelectMethod NowPlaying = 1
  ' SelectMethod UseSQLQuery = 2
  ' SelectMethod UseSQL = 3
  ' SelectMethod SelectedSongs = 4
 
  SampleID = 13123
  {{{3|-}}}New{{{2|-}}} = "Mamma Mia"
  Set objSongList = SDB.NewSongList                                        'SelectMethod 2 and 3
 
  Select Case SelectMethod
    Case 1
      Set objSongData = SDB.Player.CurrentSong
    Case 2
      Set objSongListiterator = SDB.Database.QuerySongs("AND Songs.ID=" & SampleID)
    Case 3
      SQLString = "SELECT {{{5|-}}} FROM {{{4|-}}} WHERE {{{4|-}}}.ID = " & SampleID
      Set objSongListiterator = SDB.Database.OpenSQL(SQLString)
    Case 4
      Set objSongList = SDB.SelectedSongList
'      Set objSongList = SDB.CurrentSongList
'      Set objSongList = SDB.AllVisibleSongList
    Case Else
      SDB.MessageBox "Incorrect Select Method ", mtError, Array(mbOK)
      Exit Sub
  End Select
 
  For iCounter = 0 to objSongList.count - 1                                'SelectMethod 4
    While Not objSongListiterator.EOF                                      'SelectMethod 2 and 3
      Set objSongData = objSongListiterator.Item                          'SelectMethod 2
      objSongList.Add(objSongData)                                        'SelectMethod 2
      Set objSongData = objSongList.Item(iCounter)                        'SelectMethod 4
      {{{3|-}}}{{{2|-}}} = objSongData.{{{2|-}}}{{#ifeq:{{{3|-}}}|Object|.Member|}}                                      'SelectMethod 1, 2 and 4
      SDB.MessageBox "Value = '" & {{{3|-}}}{{{2|-}}} & "'", mtError, Array(mbOK) 'SelectMethod 4 (2 and 3)
      {{{3|-}}}{{{2|-}}} = objSongListiterator.StringByIndex(0)                  'SelectMethod 3
    objSongListiterator.Next                                              'SelectMethod 2 and 3
    Wend                                                                  'SelectMethod 2 and 3
  Next                                                                    'SelectMethod 4
  Set objSongListiterator=Nothing                                          'SelectMethod 2 and 3
  SDB.MessageBox "Value = '" & {{{3|-}}}{{{2|-}}} & "'", mtError, Array(mbOK)
'  objSongData.{{{2|-}}} = {{{3|-}}}New{{{2|-}}} 'Commented Out For Safety 'SelectMethod 1, 2 and 4
'  objSonglist.UpdateAll              'Commented Out For Safety
                          'SelectMethod 1, 2 and 4 Updates db and writes tags (if checked in options)
End Sub

Latest revision as of 02:12, 22 April 2008

{{{2}}}

Example Code

Complete script

Sub

  For iCounter = 0 to objSongList.count - 1                                    'SongLists
      Set objSongData = objSongList.Item(iCounter)
      -- = objSongData.-
      SDB.MessageBox "Value = '" &  -- & "'", mtError, Array(mbOK)    'SDB.MessageBox
  Next
' objSongData.- = -New- 'Commented Out For Safety
' objSonglist.UpdateAll              'Commented Out For Safety                 'UpdateAll
                         Updates db and writes tags (if checked in options)
End Sub