Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
General field by the use of the marker
Message
From
11/12/2009 05:39:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/12/2009 01:38:40
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01438561
Message ID:
01438577
Views:
64
>Hi Cetin
>
>In message #662467, you describe an approach of extracting a general field into a file by the use of the 579 marker. I tried this:
>
>
>FUNCTION SaveIt2
>PARAMETER tcFile
>lcTemp = sys(2015)
>lcOutFileName = "New-"+ALLTRIM(STR(RECNO()))+"."+tcFile
>copy fields z_data to (lcTemp) next 1
>
>Hin = fopen(lcTemp+".fpt")
>hout=fcreate(lcOutFileName)
>lnSize=fseek(hin,0,2)
>fseek(hin,0x204,0) && Move file pointer to offset 0x204 where file size is stored
>lnSize = 0
>for ix=4 to 1 step -1
>	lnSize=lnSize+asc(fread(hin,1))*256^(ix-1)
>endfor
>fwrite(hout,fread(hin,lnSize),lnSize)
>=fclose(hin) and fclose(hout)
>erase (lcTemp+'.*')
>
>
>The various types of documents I have are:
>
>Word.Document.12
>AcroExch.Document.7
>Excel.Sheet.8
>Word.Document.8
>
>In all of them, I end up in non recognized document when I try to open them in Word, Excel of Acrobat Reader. Would you have or anyone has an idea about what I am missing here?

Oh that message is from 2002:) I don't know what you might be missing, didn't deal with general fields for a very long time. Looking at your data with an hex editor like VFP's hexedit might reveal some info. My guess is that your general fields may be using link in which case the original of the file should be there on disk too.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform