I have a HS2 script that I have used for years that I would like to use in HS3. It's wordOfTheDay.vb.
I am getting this error when it runs in HS3:
Compiling script wordOfTheDay_3.vb: Namespace or type 'System.Xml' has already been imported.
Oct-28 7:02:46 PM Error Compiling script wordOfTheDay_3.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Here is the script:
Public Sub Main(ByVal parm As Object)
Dim m_xmld As XmlDocument
Dim m_node As XmlNode
Dim Word As XmlNode
Dim Deff As XmlNode
Dim speakMsg As String = ""
Dim I As Integer
Dim attentionFileFolder As String = "wave\"
Dim attentionFile As String = "m304.wav"
Dim host As String = "Perseusefault"
hs.SetDeviceValueByRef(132, 1, True)
'folder\ filename|x|yyy where x= announcement type and yyy is volume"
attentionFile = attentionFileFolder & attentionFile
hs.RunScriptFunc("playMediaFile_3.vb", "Main", attentionFile & "|1|70", True, False)
m_xmld = New XmlDocument
m_xmld.Load("http://wordsmith.org/awad/rss1.xml")
Word = m_xmld.SelectSingleNode("rss/channel/item/title")
Deff = m_xmld.SelectSingleNode("rss/channel/item/description")
speakMsg = speakMsg & ("Today's word is, <silence msec='200'/>" & Word.InnerText & ".")
speakMsg = speakMsg & ("<silence msec='800'/>")
speakMsg = speakMsg & (Word.InnerText & ", is spelled, <silence msec='200'/>")
For I = 1 To Len(Word.InnerText)
speakMsg = speakMsg & (UCase(Mid(Word.InnerText, I, 1))) & ", . " & "<silence msec='300'/>"
Next
speakMsg = speakMsg & ("<silence msec='500'/>")
speakMsg = speakMsg & (Word.InnerText & "<silence msec='300'/>")
speakMsg = speakMsg & ("The definition is, <silence msec='500'/>" & Deff.InnerText)
speakMsg = speakMsg & ("<silence msec='600'/>" & Word.InnerText)
hs.Speak(speakMsg, True)
'speakMsg = Nothing
End Sub
Any ideas on how I can get it to work in HS3 would be much appreciated!!
I am getting this error when it runs in HS3:
Compiling script wordOfTheDay_3.vb: Namespace or type 'System.Xml' has already been imported.
Oct-28 7:02:46 PM Error Compiling script wordOfTheDay_3.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Here is the script:
Public Sub Main(ByVal parm As Object)
Dim m_xmld As XmlDocument
Dim m_node As XmlNode
Dim Word As XmlNode
Dim Deff As XmlNode
Dim speakMsg As String = ""
Dim I As Integer
Dim attentionFileFolder As String = "wave\"
Dim attentionFile As String = "m304.wav"
Dim host As String = "Perseusefault"
hs.SetDeviceValueByRef(132, 1, True)
'folder\ filename|x|yyy where x= announcement type and yyy is volume"
attentionFile = attentionFileFolder & attentionFile
hs.RunScriptFunc("playMediaFile_3.vb", "Main", attentionFile & "|1|70", True, False)
m_xmld = New XmlDocument
m_xmld.Load("http://wordsmith.org/awad/rss1.xml")
Word = m_xmld.SelectSingleNode("rss/channel/item/title")
Deff = m_xmld.SelectSingleNode("rss/channel/item/description")
speakMsg = speakMsg & ("Today's word is, <silence msec='200'/>" & Word.InnerText & ".")
speakMsg = speakMsg & ("<silence msec='800'/>")
speakMsg = speakMsg & (Word.InnerText & ", is spelled, <silence msec='200'/>")
For I = 1 To Len(Word.InnerText)
speakMsg = speakMsg & (UCase(Mid(Word.InnerText, I, 1))) & ", . " & "<silence msec='300'/>"
Next
speakMsg = speakMsg & ("<silence msec='500'/>")
speakMsg = speakMsg & (Word.InnerText & "<silence msec='300'/>")
speakMsg = speakMsg & ("The definition is, <silence msec='500'/>" & Deff.InnerText)
speakMsg = speakMsg & ("<silence msec='600'/>" & Word.InnerText)
hs.Speak(speakMsg, True)
'speakMsg = Nothing
End Sub
Any ideas on how I can get it to work in HS3 would be much appreciated!!
Comment