Guest mmckenna_itpro@hotmail.com Report post Posted 04/13/2004 08:44 PM Hi, I want to use the format number module to speak a date. I'm pulling the date from an SQL server database. The format number module is expecting a date in the format MMDDHHNN. How do I get the date in this format before passing it to the say number block? I tried putting in an evaluation block to format the date using the vbscript 'format' function, but still no luck. The format block is generating a run time error, but I can't figure out why, even when I looked in the script file. Suggestions? Mike. Share this post Link to post
SupportTeam Report post Posted 04/13/2004 10:33 PM Can you post a trace which shows us what format the date retrieved from the database is in. (the trace showing the script trying the 'format' function should be fine.) Share this post Link to post
Guest mmckenna_itpro@hotmail.com Report post Posted 04/14/2004 02:06 PM Hi, Find attached trace. This is the error line. 100113.63 5 Error: 1006. Mike. 0414vgm.txt Share this post Link to post
SupportTeam Report post Posted 04/15/2004 12:30 AM The function "Format" is not a VBScript function. (For a list of VBScript functions please see: http://msdn.microsoft.com/library/en-us/sc...vbscripttoc.asp ) There are functions like "FormatDateTime" and "FormatNumber" but they are not really what you need... From trace we can see that your database returns date information in this format: 4/1/2004 7:32:09 AM to get that in the "mmddhhnn" format you basically would need to do a fair bit of string manipulation using functions instr() and mid() - but a much easier way is to just use the Text-To-Speech engine to day the date (I notice that you are using TTS a lot in your script to speak out the data retrieved from databases). Have a look at your TTS engine manual and see what (if any) labels or other TTS engine instructions you may need to use to get the TTS engine to just say "4/1/2004 7:32:09 AM" as the date and time. If you want to use the mid() and instr() functions to extract individual month/day/hour/minute numbers from the supplied string then the attached "Evaluate Expression Tester" should be useful for you. EvalExprTest.zip Share this post Link to post
Guest mmckenna_itpro@hotmail.com Report post Posted 04/16/2004 02:00 PM Hi, Thanks for that catch. I forgot format is not a vbscript keyword. Regarding formatting in TTS - the Microsoft SAPI documentation uses context tags to specify fields formatting. Ex: <CONTEXT ID = "date_mdy"> 12/21/99 11/21/99 10/21/99 </CONTEXT> Will this work in the VoiceGuide TTS module? Mike. Share this post Link to post
Guest mmckenna_itpro@hotmail.com Report post Posted 04/16/2004 03:15 PM Hi, Now I'm getting really aggravated with this software package. 1. This is the field that I have in a 'text to speak' block: Alarm occurred at <CONTEXT ID = "date_mdy"> 12/21/99 </CONTEXT> This is from the Microsoft SAPI documentation. Why doesn't this work? 2. I'm reading a date from a MS SQL database with a database query module. When I try to assign the a value of the query to a variable, the variable is being replaced with the value from the query. See code below. dim sIn dim sOut dim sMinute dim sHour dim sDay dim sMonth dim sYear dim sTemp ' this is the problem sTemp = 4/1/2004 7:32:09 AM Get back to me. Mike. Share this post Link to post
SupportTeam Report post Posted 04/16/2004 11:35 PM What Text-To-Speech commands will work depends on which TTS engine you are using... VoiceGuide just passes whatever is specified in the TTS part of the module to the TTS engine and the TTS engine is responsible for correctly recognising all the tags embeddd in the text to be spoken and correctlyu sepeaking the information. The MS documentation applies to the standard MS TTS engine supplied with SAPI5 - is that what you are using or did you buy some other engine to replace the standard ones? You may want to read: http://voiceguide.com/forums/index.php?showtopic=634 according to there you may what to try: <p><say-as type="date:mdy">12/21/99</say-as></p> Share this post Link to post