Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MS Comm experts
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00614817
Message ID:
00617402
Vues:
36
First, the last thing you should be doing is THISFORM.buffer = "". Try something like this instead:
if this.commevent = 2
   thisform.buffer = thisform.buffer + this.input
   * Assuming a CR at the end of the scan
   IF CHR(13)$THISFORM.inbuffer
       lnscansize = AT(CHR(13),THISFORM.inbuffer)
       * extract scan
       lcmydesiredscan = SUBSTR(THISFORM.inbuffer,1,lnscansize)
       *delete scan
       THISFORM.inbuffer = SUBSTR(THISFORM.inbuffer,lnscansize+1)
   ENDIF
or something similar. This leaves the .inbuffer intact in the case there are multiple scans in the buffer.


>I am still trying to figure out what is going on here. In the OnComm method I have
>
>if this.commevent = 2
>   thisform.buffer = ""
>   thisform.buffer = this.input
>...
>
>
>Then when I debug the first time it is fine. The second time it looks like it adds the input to the previous input but it is truncated. Not 2 complete data scans. What do I need to do to reset this object?
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform