Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Impossible String !
Message
From
19/11/2015 04:04:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01627611
Message ID:
01627620
Views:
80
Add a memo field for tracing intermediate results, as setting a breakpoint only happens when the "bad" data is already built or even worse only sometimes with client data in runtime - and clean up your code!
SET CENTURY ON
SET DATE TO YMD

if m.goApp.lTrace
     local lcTrace
     lcTrace = "Enter" + chr(13) + m.lcText
endif

lcText = m.lcText + "^" + STRTRAN(ALLTRIM(TTOC(rx.filled_date + rx.days_supply)),"/","-") + "^|"

if m.goApp.lTrace
    ** add more INfo / steps to lcTrace Variable as you need before the check at end
     lcTrace =  m.lcTrace ;
                        + Chr(13) + "date+supply" + TTOC(rx.filled_date + rx.days_supply);
                        + Chr(13) + m.lcText
endif

SET DATE TO AMERICAN
SET CENTURY OFF
* Price Override (Not supported) (position 39)
lcText = m.lcText + "^^|"
* Diagnoses (Code and Qualifier) (position 40 - 41)
IF USED("diagnoses")  and THIS.m_seek(ALLTRIM(STR(rx.rx_no)) + ALLTRIM(STR(refill_no)),"diagnoses","fullrx",1)
		   lcText = m.lcText + "^" + ALLTRIM(diagnoses.diagnosis_code) + "^|";
                                              + "^" + ALLTRIM(diagnoses.diagnosis_code_qualifier) + "^|"
    if m.goApp.lTrace
         lcTrace =  m.lcTrace ;
                            + Chr(13) + "Diagnosiscodes open and found" + more info according to your tables;
                            + Chr(13) + m.lcText
    endif
ELSE
	          lcText = m.lcText + "^^|" + "^^|"
ENDIF

* Facts and Comparisions Disease Code (Not supported) (position 42)
lcText = m.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 = m.lcText + "^" + STRTRAN(ALLTRIM(TTOC(rx.written_date)),"/","-") + "^|"

SET DATE TO AMERICAN
SET CENTURY OFF

if m.goApp.lTrace and occurs( "^^|", m.lcText)>4
     If   (Working on a base table with added Trace Memo Field)
         replace cTraceMemo with m.lcTrace in WorkTable 
     else
         = StrTofile(m.lcTrace, "yourlog.txt",.t.)
     endif
     assert .f. "Wrong number of Space-Placeholders!"  && or a direct set step on if vfp.startmode or your typical check allows it
 endif
>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 !!!
>
>
>
>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
>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
>
>
>
>any ideas ???
>
>Thanks!
>Tommy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform