Posts: 451
Threads: 16
Joined: Feb 2003
Quote:For QB, I usually just say "screwit" and use something like this:
string$ = LTRIM$(RTRIM$(STR$(num)))
I used to do that too, but I found FORMAT$ which does the exact same thing with no string parameter.
ie:
string$ = FORMAT$(num)
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Posts: 3,343
Threads: 83
Joined: Mar 2003
^^^ I wrote that, not ado
I've never heard of FORMAT$ before... if that works fine then use that
Posts: 451
Threads: 16
Joined: Feb 2003
Odd, I just clicked the 'reply with quote' and stripped the rest of the message, I didn't touch the usename.
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Posts: 3,279
Threads: 170
Joined: Nov 2003
*checks the posts*
Oracle, I wrote that ya momo
you never even say "screwit" to my knowledge
I find that I never have use for string formatting...I guess it's different when you need to represent large numbers by triples though...
I'd knock on wood, but my desk is particle board.
Posts: 131
Threads: 32
Joined: Mar 2004
I used
trim$=str$(carnumber)
trim$=ltrim$(trim$)
mid$(raceentry.finishorder,p)=trim$
print using "###"; val(mid$(raceentry.finshorder,p,3))
coming from programing business basic years back, qbasic is a lot more work. In my opion, Using gosub's and goto's is ok as long as you keep everything structured and easy to follow. Also there is good spagetti and very bad spagetti.
Posts: 2,765
Threads: 138
Joined: Nov 2002
yup. that code works but i think it's better using 2 lines of code to do the same thing rather than 4
Code:
MID$(raceentry.finishorder, p) = LTRIM$(STR$(carnumber))
PRINT USING "###"; VAL(MID$(raceentry.finshorder, p, 3))
it just combines the three lines
and what you said about structured spagetti.... i think that too (Yummm spagetti)
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 131
Threads: 32
Joined: Mar 2004
Yes, you are right. I'm still trying to get used to all these different commands.
Posts: 1,956
Threads: 65
Joined: Jun 2003
I did some work myself using Business BAsic for several machines including the BAsic IV and the NCR Tower. What I liked in particular was the I/O, lots more sophisticated than what QB has. The rest of the language is fair.
*****
Posts: 451
Threads: 16
Joined: Feb 2003
Nobody has caught on to what I said yet about FORMAT$
If you use FORMAT$(num) then you don't need to use LTRIM$ since there is no leading space. Why make two function calls when you can make one. Especially when QB is so slooooow about function calls.
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Posts: 131
Threads: 32
Joined: Mar 2004
Quote:I did some work myself using Business BAsic for several machines including the BAsic IV and the NCR Tower. What I liked in particular was the I/O, lots more sophisticated than what QB has. The rest of the language is fair.
*****
I miss the direct files...this random stuff sucks