I have now found that the random file mode allows me to both read and
write data without closing the file, however when I try and write the
integer 111 (for example) the file has the character "o", the Ascii
code for decimal 111.
Any tips on using the random file mode ?
--- In [email protected], "testblokepuma" <[EMAIL PROTECTED]> wrote:
> OK, so if I open the file as follws, then increment the counter and
> write the file back...
> 
> open "pathname" for input lockreadwrite as #1
> input #1, intCount
> close #1
> 
> intCurrent = intCount 
> intcount = intcount + 1
> 
> open "pathname" for output lockreadwrite as #2
> print #2, intcount
> close #2
> 
> 1) Would this be correct ?
> 2) Does this still not allow another program to access the file
> between the input and output operation ?
> 3) Can I open the file locked and perform both the read and write
> operation before closing the file ?
> 
> Sorry if this is basics, have only ever done stand alone applications
> before without any filesharing.
> 
> --- In [email protected], Matt <[EMAIL PROTECTED]> wrote:
> > check the read only attribute when you open the file,  if it is
not set 
> > set it and open the file.   If it is set, keep trying, or throw an 
> > error.   When you are done turn it off.
> > 
> > Matt
> > 
> > testblokepuma wrote:
> > 
> > >I many label programs that all increment a counter on a server
(simple
> > >text file) for the serial number part of the label. Problem is that
> > >two different PC's are managing to open the file at the same time,
> > >therefore I am getting duplicate serial numbers (big issue with
> customer).
> > >How can I get this counter file to restrict access to one user at a
> time.
> > >Help much appreciated.
> > >
> > >Kevin
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >'// =======================================================
> > >    Rules : http://ReliableAnswers.com/List/Rules.asp
> > >    Home  : http://groups.yahoo.com/group/vbHelp/
> > >    =======================================================
> > >    Post  : [email protected]
> > >    Join  : [EMAIL PROTECTED]
> > >    Leave : [EMAIL PROTECTED]
> > >'// =======================================================
> > > 
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > > 
> > >
> > >
> > >
> > >  
> > >




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to