Open a memoreaded file without memowrite

Open a memoreaded file without memowrite

Postby dixonchu » Fri Apr 20, 2007 8: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
dixonchu
 
Posts: 21
Joined: Mon Nov 14, 2005 2:20 am

Postby Antonio Linares » Fri Apr 20, 2007 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby dixonchu » Fri Apr 20, 2007 2: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
dixonchu
 
Posts: 21
Joined: Mon Nov 14, 2005 2:20 am

Postby Antonio Linares » Fri Apr 20, 2007 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 32 guests