Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Impossible String !
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01627611
Message ID:
01627621
Vues:
58
>Hey gang!
>
>Weird problem here.
>
>We have some code (show below) that just a few times, out of thousands of time run, sends over this string
>
>^2015-10-14 12:00:00 AM^|^^|^^|^^|^^|^^|^^|^2015-08-10 12:00:00 AM
>
>instead of this....
>
>^2015-10-14 12:00:00 AM^|^^|^^|^^|^^|^2015-08-10 12:00:00 AM
>
>4 "spaces" ( the ^^| segments) should be sent if no data is in the diagnoses table.... but we are sometimes getting 6 !!!
>
> ....
>
>any ideas ???
>
>Thanks!
>Tommy

Hi Tommy:

To catch this problem, you could do something like this, and the next time it occurs, you surely have the information that causes it.
All you want to do is a proper testing inline:
SET CENTURY ON
SET DATE TO YMD
lcText = lcText + "^" + STRTRAN(ALLTRIM(TTOC(rx.filled_date + rx.days_supply)),"/","-") + "^|"
SET DATE TO AMERICAN
SET CENTURY OFF
* Price Override (Not supported) (position 39)
lcText = lcText + "^^|"
* Diagnoses (Code and Qualifier) (position 40 - 41)
IF USED("diagnoses")
   IF THIS.m_seek(ALLTRIM(STR(rx.rx_no)) + ALLTRIM(STR(refill_no)),"diagnoses","fullrx",1)
      lcText = lcText + "^" + ALLTRIM(diagnoses.diagnosis_code) + "^|"
      lcText = lcText + "^" + ALLTRIM(diagnoses.diagnosis_code_qualifier) + "^|"
   ELSE
      lcText = lcText + "^^|"
      lcText = lcText + "^^|"
   ENDIF

   * In-line test code
   IF OCCURS("^^|", lcText) <> 3 THEN
      ERROR "Invalid format! - Tecnical info: lcText=[" + lcText + "], diagnosis_code=[" + diagnosis_code + "]" ;
         + ", diagnosis_code_qualifier=[" + diagnosis_code_qualifier + "]" ; 
         + ", recno=" + TRANSFORM(RECNO("diagnoses")) + "]"
   ENDIF
ELSE
   lcText = lcText + "^^|"
   lcText = lcText + "^^|"
ENDIF
* Facts and Comparisions Disease Code (Not supported) (position 42)
lcText = lcText + "^^|"
* Date Written (position 43)
* 04/06/07 STB per Matt Bergmann - Changed format to include dashes and time
SET CENTURY ON
SET DATE TO YMD
lcText = lcText + "^" + STRTRAN(ALLTRIM(TTOC(rx.written_date)),"/","-") + "^|"
SET DATE TO AMERICAN
SET CENTURY OFF
Fernando D. Bozzo
Madrid / Spain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform