Page 1 of 1

Open a memoreaded file without memowrite

Posted: Fri Apr 20, 2007 8:07 am
by dixonchu
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

Posted: Fri Apr 20, 2007 8:21 am
by Antonio Linares
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 ? :-) ) .

Posted: Fri Apr 20, 2007 2:46 pm
by dixonchu
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

Posted: Fri Apr 20, 2007 8:04 pm
by Antonio Linares
Dixon,

yes, you can easily do it:

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

MemoWrit( "temp.txt", cText )

return "temp.txt"