×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • 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!

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

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Commas, I just can't find the commas...

Commas, I just can't find the commas...

Commas, I just can't find the commas...

(OP)
Need help finding the difference between a txt. file line limited by a "ret"(lf,cr,etc) and one limited by a comma.
 I put together a quick little pgr. to convert PC text files into C=128 numbered listings for a friend, and handled all effects except for comments containing commas.
 I can't find any way, in QBasic to tell the difference... help...

Bob

RE: Commas, I just can't find the commas...

Have you looked at
LINE INPUT
That supposed to read whole line till cr|LF, no respect to commas.

If this does not help please post text sample - what you want it to do, where it works and were it doesn't... I'm afraid I'm not quite sure what you mean otherwise.

RE: Commas, I just can't find the commas...

(OP)
Thanks, tsh73, I'll try that. Something I'm not familiar with.
 I was using "INPUT #1, a$" to get the data.

Later,
Bob

RE: Commas, I just can't find the commas...

It wasn't a line limited by the comma.  A line is limited by the return.
In your program you were reading in a variable, which with no comma was limited by the return.
If the line lengths are all the same you could check length of the A$ and if it is less than line length you know that a comma was the terminator. Then read in another variable, combine the two into A$ and check the length again.

Ed Fair
Give the wrong symptoms, get the wrong solutions.

RE: Commas, I just can't find the commas...

(OP)
Ok, I have more time now to give a test sample.

" (= starting code)
 CHARGET1 LDA #$0D ;value for a return, skip next 3
 HEX 2C ;skip next two bytes
 LDA #$20 ;enter here for value for space
 STA CHARADD1 ;set for output
 JSR CHAROUT ;for output of space,return,etc.
"
" (= my translation (so far))
2020 charget1 lda #$0d ;value for a return
2030 skip next 3
2040 .byt $2c ;skip next two bytes
2050 :lda #$20 ;enter here for value for space
2060 :sta charadd1 ;set for output
2070 :jsr charout ;for output of space
2080 return
2090 etc.
"
" (which should be this (if I could find the #%! commas))
2020 charget1 lda #$0d ;value for a return, skip next 3
2030 .byt $2c ;skip next two bytes
2040 :lda #$20 ;enter here for value for space
2050 :sta charadd1 ;set for output
2060 :jsr charout ;for output of space,return,etc.
"
  (Else an assembler will consider skip, return, & etc. as labels (without hand editing))
  (And since I've already added line numbers, changed cmds. to lower case, changed 'HEX' to '.byt' and added "$" to values, and indented non-labels, it'd only be complete to eliminate this last problem)

Thanks for the help,
Bob

RE: Commas, I just can't find the commas...

(OP)
Ed:
 As the sample above demonstrates, length is highly variable. The text that the code comes from is as much as 50 pages of single spaced text where some lines have only a <9 char. label, and others have extended comments.
:Bob

RE: Commas, I just can't find the commas...

In the sample text shown it will require the line input or as an alternative a single character input and build the line. Using the single character you could filter the commas or substitute for them.

Ed Fair
Give the wrong symptoms, get the wrong solutions.

RE: Commas, I just can't find the commas...

(OP)
Thank you very much, tsh73,

 Your suggestion of 'LINE INPUT' was the "Answer!", as I imediately realized when I finally got around to reading about it from the 'HELP' screen. Had never used that command before, obviously.
 It not only gave me the input that I wanted but reduced my program length by a third, after I removed all the, now, excess tests for handling the missing commas and the broken lines of input.

Thanks again,
Bob

RE: Commas, I just can't find the commas...

Glad it helped ;)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

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! Already a Member? Login

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