AT2k Design BBS Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages!

You are not logged in. Login here for full access privileges.

Previous Message | Next Message | Back to VBBS/VADV Script Discussion  <--  <--- Return to Home Page
   Networked Database  VBBS/VADV Script Discussion   [63 / 233] RSS
 From   To   Subject   Date/Time 
Message   Steve Winn    Bigjoe   Oneliners Script   February 6, 2006
 11:51 PM  

Re: Oneliners Script

> In a script, can you open 2 files at the same time
>
> open "filename.cfg", "O"
> open "filename.tmp", "I"

Yes and no.

Using the OPEN command, you can only open one file at a time. This really sucks
when you want to read from one file and write to another. The way you work
around this is to use the buffer. VADV's buffer is a file in your main VADV
directory called Bx.TMP (where x is a node number). So you can read and write
to two files like so:

' Set variable to the buffer.
LET B0 = "B" % !12 % ".TMP"

' Open file 1 to read from.
OPEN "FILE1.TXT", "I"

' Clear the buffer.
BUFFER CLEAR

Loop:
' Read a line.
READ L0

' If the end of the file, exit the loop.
IF L0 = "!EOF!" GOTO Loop_Exit

' Write it to the buffer.
BUFFER APPEND, L0
GOTO Loop

Loop_Exit:
' Close the open file.
CLOSE

' Now the entire file is in the buffer.. so you can copy it somewhere or
' whatever. Note: This example has no practical use.. any changes you want
' to make to the file need to be done during the loop.
LET Z0 = "COPY " % B0 % " " % "NEWFILE.TXT"
SHELL Z0


Hope that helps.

Steve


--
[AT2k] -- Your VBBS/VADV Support Center -- [www.at2k.org] -- [bbs.at2k.org]
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to VBBS/VADV Script Discussion  <--  <--- Return to Home Page

VADV-PHP
Execution Time: 0.0184 seconds

If you experience any problems with this website or need help, contact the webmaster.
VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved.
Virtual Advanced Copyright © 1995-1997 Roland De Graaf.
v2.1.241108