Basic file problems

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
nzgregor
Newbie
Posts: 1
Joined: Wed Aug 05, 2009 11:16 pm

Basic file problems

Post by nzgregor »

Hello,
I have a problem with a basic file. What I do is send a file from a scale to a label printer. The label printer has basic programming commands so i can parse the data. My problem is this, When the file sent has one line as below

003, 300 kg

I can use the code below to trim out just the weight.

CLS
HOME
BEEP
:START
A$=""
INPUT A$
C$=RIGHT$(A$,7)
A$=LEFT$(C$,4)
TEXT 41,67,"4",0,2,2,A$
TEXT 321,67,"4",0,2,2,A$
PRINT 1, 1
GOTO START
EOP
MOVE

My issue is that i have a scale that puts out two lines of text as below

2008. 12. 26 42:25
005, 1254kg

and it is only the 1254kg that i require to print. For the life of me i cannot figure out how to read in the second line. No matter what i try it only accepts the forst line of text sent to it. Any ideas.

nzgregor
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

This is not a QB code problem. Try an appropriate forum.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply