Open a memoreaded file without memowrite

Post Reply
dixonchu
Posts: 21
Joined: Mon Nov 14, 2005 2:20 am

Open a memoreaded file without memowrite

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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 ? :-) ) .
regards, saludos

Antonio Linares
www.fivetechsoft.com
dixonchu
Posts: 21
Joined: Mon Nov 14, 2005 2:20 am

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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"
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply