This section is all about getting text into your processing environment.
To retrieve text from a table field, simply assign it to a memory variable. Desc * Note that it doesn't matter if the field is type Character or Memo. For example, the following code executes in one-seventh of a second on my 220Mhz Pentium laptop. Low Level File Functions ( LLFF ) are somewhat more cumbersome but offer great control. The following example reads the entire contents of Tolstoys LOCAL t1, t2, i, h LOCAL ARRAY wp Lines CLEAR t1 = SECONDS() h = FOPEN( "War And Peace.
CREATE TABLE Ships ( Name C( 40 ), Desc M ) INSERT INTO Ships ( Name, Desc ) VALUES ( "Exxon Valdez", "Billions unpaid! is used to place the contents of a disk file into a string memory variable. TXT" ) && 3.2 mb in size FOR i = 1 TO ALEN( wp Lines ) wp Lines[i] = FGETS( h ) ENDFOR t2 = SECONDS() ?
t2-t1, "seconds" && 0.000 seconds FOR i = 1 TO ALEN( wp Lines ) ?
This article serves to introduce, illustrate, and explore some of the great ( and not so great ) string handling capabilities of Visual Fox Pro.
I always seem to be involved with solving many text-data related problems in my VFP projects.
TXT" ) && 3.2 mb in size FSEEK( h, 1500000 ) && Move the pointer x = FREAD( h, 1000 ) && Read 1000 bytes t2 = SECONDS() ?
t2-t1, "seconds" && 0.000 seconds SET MEMOWIDTH TO 8000 ?