Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I do this in VFP (STDIO via FGETS)
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00087924
Message ID:
00087980
Views:
44
>I'm trying to write a program that needs access to STDIO. Here's the C equivalent:
>
>#DEFINE MAX_LINE 4096
>char line [MAX_LINE];
>
>fgets( line, MAX_LINE, stdin );
>
> This is pretty straightforward, but it doesn't look like the VFP version of FGETS has a STDIO operator. I think I'm missing something really stupid...
>
> Here's what I think I'd need to do, if I could figure out how to pass a handle to STDIO in VFP:
>
>cLine = FGETS(STDIO,MAX_LINE)
>
>Ideas?
>
>-Paul

Paul,
Just to confirm that Marc is correct in his reply. There is no stdio library in VFP as there is in C - fgets is exactly the same in VFP as C (except that you don't limit the characters). Just say string=fgets(handle) - after issuing handle=fopen(filename) - these functions are contained as standard within VFP. As with C, fgets will read until the newline (CR/LF). Also, fputs is almost the same in VFP as in C. Regards,
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform