Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can anyone translate this?
Message
 
 
À
07/10/1999 11:53:32
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00273660
Message ID:
00273760
Vues:
20
>>I don't know 2.5 very well. Can anyone tell me what the equivalent commands would be so I can make this 5.0 code work in 2.5?
>>
>>
>>
>>*-- Declare the file handle variables and the line variables
>>LOCAL lcInfile, lcOutFile, lcInLine, lcOutLine
>>
>>*-- Open the input file
>>lcInFile = FOPEN('ck990708.dat')
>>*-- Create the output files
>>lcOutFile = FCREATE('clock.dat')
>>
>>*-- Read the header line
>>lcInLine = FGETS(lcInFile)
>>*-- Modify the header line
>>lcOutLine = "P001"+SUBSTR(lcInLine,5,9)+RIGHT(lcInLine,6)
>>*-- Write the header line to the output file
>>FPUTS(lcOutFile,lcOutLine)
>>
>>*-- Do loop until the end of the input file
>>DO WHILE NOT FEOF(lcInFile)
>>   *-- Read in a line
>>   lcInLine = FGETS(lcInFile)
>>   *-- Modify the line
>>   lcOutLine = LEFT(lcInLine,8)+SUBST(lcInLine,11,6)+RIGHT(lcInLine,6)
>>   *-- Write the modified line out to the output file
>>   FPUTS(lcOutFile,lcOutLine)
>>ENDDO
>>
>>*-- Close the input and output files
>>FCLOSE(lcInFile)
>>FCLOSE(lcOutFile)
>>
>>
>>
>>Thanks,
>>
>>Michelle
>
>
Hi Michelle,
>I think this was "my curiosity" code :) Just seeing the names of repliers absolutely you should have been corrected it by now (I bet).
>I wanted to make some side notes :
>set memowidth to 1024 && Prevents some wrong wrappings with fputs(), fgets()
>use fputs(), fread(), fwrite(), fgets() with optional parameter nBytes (ie:You could set it to 65535). As far as I remember it defaults to 254 if you don't specify (which is enough for most operations).
>Cetin

Yeah, 254 is plenty. The lines are only about 25 characters long.

Thanks,

Michelle
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform