Dear Mentors
I am able to save and restore a mem file using Getfile function but
It makes me select a file from a specified folder even if there
is only one such file nd you already know its name?
Is there a way for open a file without the complete dialog?
Ex file myarrrays.mem
as in Fopen(c:\hmgstorage\myarrays.mem instead of getfile(c:\hmgstorage\myarrays.mem) or some such function
Thanks for looking at my queery.
Opening a known file name
Moderator: Rathinagiri
Re: Opening a known file name
Ya trataste con esto ?
+-------------------------
Have you tried this yet?
RESTORE FROM "c:\hmgstorage\myarrays.mem"
+-------------------------
Have you tried this yet?
RESTORE FROM "c:\hmgstorage\myarrays.mem"
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: Opening a known file name
Thanks for the reply but restore from cannot recall array memvars according to the
Clipper reference. "Arrays and local variables cannot be SAVEd or RESTOREd."
I think there is a function in Harbour somewhere but I can't find a description of it. HB_restore or something like that.
If anyone knows the document describing it please post a reply.
Clipper reference. "Arrays and local variables cannot be SAVEd or RESTOREd."
I think there is a function in Harbour somewhere but I can't find a description of it. HB_restore or something like that.
If anyone knows the document describing it please post a reply.
Re: Opening a known file name
I'm using such a trick to save array in .mem file:
and a piece of code to restore:
Code: Select all
cTemp := "{ || aArrayToSave := " + hb_valtoexp(aArrayToSave) + "}"
save all like cTemp to "c:\hmgstorage\myarrays.mem"
Code: Select all
if file("c:\hmgstorage\myarrays.mem")
BEGIN SEQUENCE with {|e| break(e)}
restore from ("c:\hmgstorage\myarrays.mem") additive
if type(cTemp) <> "U"
eval(&cTemp)
endif
END SEQUENCE
endif
Re: Opening a known file name
Well! that's some trick. Its going to take me a while to understand but I'll give it a try.
BTW Where are all those HB functions described? I have seen list of them but no reference to use.
Thanks
BTW Where are all those HB functions described? I have seen list of them but no reference to use.
Thanks
Re: Opening a known file name
I have uploaded code for saving and restoring array to and from text file, you may check it.
viewtopic.php?p=58701#p58701
Regards,
Anand
viewtopic.php?p=58701#p58701
Regards,
Anand