Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I can't start my day without this site!..."

Geography

Where in the world do Tek-Tips members come from?
Tio2000 (Programmer)
11 Jun 02 0:53
I just started programming on BBx and have to code a normally simple program...
But I don't have any idea of the all the possibilities and commands in BBx.
I have to open an existing file with some printer settings, and have to split every printer into a new file.

Every block of printer settings looks like that:

printername/description:/
setting1:/
setting2:/
:

nextprintername/description:/
setting1:/

and so on.

Now I have to create a file with the printername.
Then I have to read every line of the settings into this new file.
The Combination ":/" shows, that there is still comming up and ":" not followed by a "/" means the end of  the printer settings.

Sorry for my poor english, but i really need help!
I would be very greatful, if somebody could post some commands to solve this problem!

Greetings from Germany
patw (IS/IT--Management)
12 Aug 02 20:36
I assume this is a simple text file?

And each line is terminated by LF or CRLF?

If so, heres a way:

100 open(1)"filename"
110 read (1,end=EOF)DTA$
120 if DTA$="" goto 110; rem catch lf alone
130 if !(pos(":/"=DTA$) gosub Do_WRITE; DTA2$=""
140 DTA2$=DTA2$+DTA$+$OA$;rem use $0D0A$ on Windows
150 goto 110
200 DO_WRITE:
210 <put logic to create the new file here, then open it>
220 write (new_file)DTA2$,; close(new_file)
230 return
900 EOF:
910 gosub DO_WRITE
920 end

There's a german language news group on the news.basis server, and you should sign up for the basis mailing list at the Basis web site.

Pat Welch, UBB Computer Services
           Caldera Authorized Partner  
           Unix/Linux/Windows/Hardware Sales/Support
           (209) 745-1401 Fax: (413) 714-2833

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close