Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MSCOMM32 write method?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00283794
Message ID:
00283848
Vues:
7
>>buffer = FILETOSTR('Label.txt')
>>oComm.output = buffer
>>
>>will work with small files, or you can use low-level file I/O to read a line at a time from the file and stuff it out the control - you'll need to make sure to send CR/LFs if you read a line at a time from the file.
>
>
>I will first try the file to string first. Otherwise this is what is getting written to the file:
>
> =Fput(gnErrFile, CHR(2)+CHR(76)+CHR(87)+CHR(72)+CHR(16)+CHR(13) )
> =Fput(gnErrFile, "1X1100000000005B443225002002"+CHR(13))
> =Fput(gnErrFile, "1X1100001120005L448002"+CHR(13))
>
>So changing the fput to a oComm.output shouldn't be tough. You just cant call a proc inside a method, and I hate writing another method for that output call.
>

Why not? As long as the procedure can be found, you should be able to call UDFs from within an object - I do it all the time since many of my classes are non-visual and the class definitions are in procedure files. You can't rely on using "this", "thisform", etc, but you can always pass object refs as a parameter...

Try this: Create procedure file called TURNBLUE.PRG

*TurnBlue.PRG
LPARAMETER oThis
othis.forecolor = RGB(0,0,255)

Take a form and add the following to some control's Click() method:

*RandomControl Init
=Turnblue(this)

run your form - when you click that control, the function will fire and change the forecolor.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform