FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Open a memoreaded file without memowrite
Posts: 21
Joined: Mon Nov 14, 2005 02:20 AM
Open a memoreaded file without memowrite
Posted: Fri Apr 20, 2007 08:07 AM

Dear All

If I Read an entire file from disk into memory

cString = MemoRead( <cFileName> )

How can I use this string without Written to a file

MemoWrit( <cFileName>, <cString> )

For example , If cFileName is a "test.dbf"

ctest = memoRead("test.dbf")

USE ctest , or USE xxx(ctest)

without MemoWrit( "test.dbf", ctest )

Anyone can help

Thanks

Dixon Chu

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Open a memoreaded file without memowrite
Posted: Fri Apr 20, 2007 08:21 AM

Dixon,

If you load a DBF file into memory using MemoRead(), you can not USE it.

You may need a new and special RDD for such purpose (MEMRDD ? :-) ) .

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 21
Joined: Mon Nov 14, 2005 02:20 AM
Open a memoreaded file without memowrite
Posted: Fri Apr 20, 2007 02:46 PM

Antonio

Sorry, I give you a incorrect example.

The thing is I have to use a OCX method , like oActivex:GetLocalFile( <cFileName> )

That function I can't change it .

But I want to save the <cFileName> into Memo fields first ,

then oActivex::GetLocalFile( xxx(<memo field>) )

The function xxx is convert the memo to disk file

for example

REPLACE ALIAS->MEMOFIELD WITH MEMOREAD(<cFileName>)

Then

oActivex::GetLocalFile(xxx(ALIAS->MEMOFIELD))

so, I can store the disk file to Memo fields

anyone can help

Regards

Dixon Chu

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Open a memoreaded file without memowrite
Posted: Fri Apr 20, 2007 08:04 PM

Dixon,

yes, you can easily do it:

oActivex:GetLocalFile( FieldToFile( ALIAS->MEMOFIELD ) )
...
function FieldToFile( cText )

MemoWrit( "temp.txt", cText )

return "temp.txt"

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion