KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: can't understand this bug-can sdy help me see ?
Topic Summary:
Created On: 06/08/2021 04:36 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 can't understand this bug-can sdy help me see ?   - dicdoc - 06/08/2021 04:36 PM  
 can't understand this bug-can sdy help me see ?   - PG LTU - 06/08/2021 04:43 PM  
 can't understand this bug-can sdy help me see ?   - speechpro - 06/08/2021 09:20 PM  
 can't understand this bug-can sdy help me see ?   - speechpro - 06/08/2021 09:42 PM  
Keyword
 06/08/2021 04:36 PM
User is offline View Users Profile Print this message

Author Icon
dicdoc
Top-Tier Member

Posts: 292
Joined: 07/31/2014

I use a voice command to choose a date, yesterday's date, tomorrow, etc... and I want to get this date in a variaable in different formats :

all variable are defined

If ListVar1 = "aujourd'hui" Then DATEPAIEMENTLEFT = ""& Format (Now + 0, "yyyymmdd-")
 If ListVar1 = "d'aujourd'hui" Then DATEPAIEMENTLEFT = ""& Format (Now + 0, "yyyymmdd-")
 If ListVar1 = "demain" Then DATEPAIEMENTLEFT = ""& Format (Now + 1, "yyyymmdd-")
 If ListVar1 = "à demain" Then DATEPAIEMENTLEFT = ""& Format (Now + 1, "yyyymmdd-")
 If ListVar1 = "hier" Then DATEPAIEMENTLEFT = ""& Format (Now -1, "yyyymmdd-")
 If ListVar1 = "d'hier" Then DATEPAIEMENTLEFT = ""& Format (Now -1, "yyyymmdd-")
 If ListVar1 = "il y a 2 jours" Then DATEPAIEMENTLEFT = ""& Format (Now -2, "yyyymmdd-")
 If ListVar1 = "il y a 3 jours" Then DATEPAIEMENTLEFT = ""& Format (Now -3, "yyyymmdd-")
 If ListVar1 = "il y a 4 jours" Then DATEPAIEMENTLEFT = ""& Format (Now -4, "yyyymmdd-")


msgbox(DATEPAIEMENTLEFT & " " & Format (Now + 0, "yyyymmdd-"))

DATEPAIEMENTRIGHT = DATEPAIEMENTLEFT
msgbox(""& Format (DATEPAIEMENTLEFT, "yy.mm.dd"))
DATEPAIEMENTRIGHT = ""& Format (DATEPAIEMENTLEFT, "dd.mm.yyyy")

===
1st messagebox work error freee
2nd message box gives "errir 10620 : invalid function argument value
last line too
===
Why this error ?


-------------------------

Memory: 16GB Microphone Brand and Model: LFH 4000 & Flexy Mike  Operating System: win 10, latest update; Surface Book 2, Processor (CPU) Type & Speed: I7 8650 Soundcard Brand and Model: none Speech Software: Dragon Medical Practice Edition, french version: 4.2 Using KnowBrainer?:Yes

 06/08/2021 04:43 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2210
Joined: 03/21/2007

Double double quotes may be the problem. That turns into an escaped single open or close double quote character to use within a string (itself demarcated by double quotes). So why do you need it? Either put something in the string between the double quotes or exclude it (plus the "&" concatenation symbol since thee is nothing to concatenate anyway).
HTH



-------------------------




PG





Remember folks, my comments and this forum are for entertainment value only, please, no wagering or other reliance on the contents herein.  I permit no commercial use of my ideas (whether expressions or embodiments) without my written consent.



 06/08/2021 09:20 PM
User is offline View Users Profile Print this message


speechpro
Senior Member

Posts: 86
Joined: 11/09/2006

Double double quotes are not the problem (though not necessarily needed either). The variables as assigned are handled as type (string). Format() function varies based on expression type - strings can't be formatted with a date pattern.

 06/08/2021 09:42 PM
User is offline View Users Profile Print this message


speechpro
Senior Member

Posts: 86
Joined: 11/09/2006

*If you need two different date formats mixed as in your example (if not, tweak as needed) - I don't have advanced scripting open, so may not be 100% - give it a try...

DATEPAIEMENT = Now

If right(ListVar1,3) = "hui" Then DATEPAIEMENTFULL = Format (DATEPAIEMENT, "yyyymmdd-") & Format(DATEPAIEMENT, "dd.mm.yyyy")
If right(ListVar1,6) = "demain" Then DATEPAIEMENTFULL = Format (DATEPAIEMENT+1, "yyyymmdd-") & Format(DATEPAIEMENT+1, "dd.mm.yyyy")
If right(ListVar1,4) = "hier" Then DATEPAIEMENTFULL = Format (DATEPAIEMENT-1, "yyyymmdd-") & Format(DATEPAIEMENT-1, "dd.mm.yyyy")
If left(ListVar1, 7) = "il y a " then
njour = val(mid(ListVar1,8,1))
DATEPAIEMENTFULL = Format (DATEPAIEMENT-njour, "yyyymmdd-") & Format(DATEPAIEMENT-njour, "dd.mm.yyyy")
end if

msgbox DATEPAIEMENTFULL



Statistics
32323 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 1 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 482 guests browsing this forum, which makes a total of 483 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.