I would like to be able to get a string using GETSTR or GETLINE, and be able to print out the STR with the added empty characters afterwards as well spaces. For example:
GETSTR 40
PRINT STR
But, when the STR is printed, have it output all 40 characters, even if all aren't used. Is there a way to do this in Baja? So, instead of:
I have been writing some Baja modules for my BBS, and I have had a lot o luck with it so far. I have been able to do everything as I have wanted exc for one thing.
I would like to be able to get a string using GETSTR or GETLINE, and be able to print out the STR with the added empty characters afterwards as well spaces. For example:
GETSTR 40
PRINT STR
But, when the STR is printed, have it output all 40 characters, even if all aren't used. Is there a way to do this in Baja? So, instead of:
But, when the STR is printed, have it output all 40 characters, even all aren't used. Is there a way to do this in Baja? So, instead of:
printf "%40s" str
-Rob
[Reply to]: GETSTR
[Typed by]: Digital Man to Willowolf on Thu Jan 17 2002
02:46 am
But, when the STR is printed, have it output all 40 characters, e all aren't used. Is there a way to do this in Baja? So, instead of:
printf "%40s" str
-Rob
I knew there was a way! Thanks again Rob!
This works good, but it prints out the string after the spaces like so:
Name One - comment - hours
Name Two - second comment - hours
Name Three - third comment - hours
The '-' being the beginning of the next string.
Is there a way to have it print before the left over spaces liks so?:
Name One - comment - hours
Name Two - second comment - hours
Name Three - third comment - hours
printf "%40s" str
This works good, but it prints out the string after the spaces like so:
Is there a way to have it print before the left over spaces liks so?:
The '-' being the beginning of the next string.
Is there a way to have it print before the left over spaces liks so?:
Name One - comment - hours
Name Two - second comment - hours
Name Three - third comment - hours
printf "%-40s" str
-Rob
Is there a way to have it print before the left over spaces liks so?:
PRINTF "%-40s" str
You might wanna try reading the docu.....
Is there a way to have it print before the left over spaces liks so?:
PRINTF "%-40s" str
You might wanna try reading the docu.....
I have many times... My eyes have glazed over and I'm tierd of reading it. I turn to the Baja Discussion sub when I get tierd, or just don't understand it. I appologize for the simplicity of my questions.....
But the docu for BAJA is a pretty good REFERENCE (it doesn't pretend to be much of a tutorial). Also I tyake it you are fairly new to programming?
The "Print Formatted" command is pretty standard in a number of languages (BAJA, C/C++, JS, Perl, etc) so I gather you have not had much exposure...
What woud be a good "first" language to learn? I have been told that C is the way to go. Maybe Perl is the better way to go for today's needs?
What woud be a good "first" language to learn? I have been told
that C++ is the way to go. Maybe Perl is the better way to go for
today's needs?
Unfortunately, I feel they don't address Perl too well to people who have never written code before.
Heh! That's putting it mildly! Some of the docu for some of the functions says "This function does exactly what you would expect."
Which is fine, so long as you know WHAT to expect.....
So I would suggest Java right now. It lets you dabble with GUIs and sockets without having to make big choices in what libraries to use. It is also becoming more popular, and can give you an edge. So far, I see that RI and Cornell are putting their eggs into the Java basket. I dunno if that means anything to you though.
So I would suggest Java right now. It lets you dabble with GUIs and sockets without having to make big choices in what libraries to use. It also becoming more popular, and can give you an edge. So far, I see that and Cornell are putting their eggs into the Java basket. I dunno if that means anything to you though.
Great! Another vote to start with Java.
isWhat woud be a good "first" language to learn? I have been told
that C++ is the way to go. Maybe Perl is the better way to go for today's needs?
I usually don't respond to these since I went through this whole phase myself. As far as C++ is concerned, people say to learn C first. I now disagree and think one should just go straight to the C++. IMO It's much easier to take in object-oriented programming when your programming mind
still a clean slate. The only problem is you'll be left with little idea about proper object-oriented design. Few C++ books explain this well, although there are plenty of software engineering texts on design alone.Programming
A better idea IMO is to learn Java. It's not as cruel as C++, but it follows a very similar format. Java is gaining steady market share for developing applications. IIRC, the author of the Advanced Perl
textbook suggested using Java as the application language, and Perl as a scripting language.sure.
Now we're on the topic of Perl. It's a very powerful language, to be
However, it still holds best for writing scripts. That is, something that doesnt have to be lightning fast, but needs to be developed lightningfast.
The downside here is the best books for Perl IMO are the O'Reilly books. Unfortunately, I feel they don't address Perl too well to people who have never written code before.is
So I would suggest Java right now. It lets you dabble with GUIs and sockets without having to make big choices in what libraries to use. It
also becoming more popular, and can give you an edge. So far, I see thatRIT
and Cornell are putting their eggs into the Java basket. I dunno if that means anything to you though.
.. WARNING: Habit forming, administer conservatively
--- MultiMail/Win32 v0.42
þ Synchronet þ My Brand-Spanking New Guinea Pig BBS!
There is one other difference between Javascript and Java, Javascript is eas to work with and the synax is quite different from what we worked on in college.
Just to clarify, Java and JavaScript are two very different things. Java is language and a run-time environment devloped by Sun. JavaScript is strictly scripting language with a syntax similar to Java but used for very different tasks. JavaScript was developed by Netscape and was originally named LiveScript, was renamed to "JavaScript" to ride the hype of Java.
RE: GETSTRis eas
BY: Darqualan to Digital Man on Tue Jan 22 2002 11:43 pm
There is one other difference between Javascript and Java, Javascript
thatto work with and the synax is quite different from what we worked on in college.
In the grander scheme of things, they're pretty close. I understand
for a Java app to launch it needs a main method contained in an object,and
that's the big difference right away.language, if
However, compare it to.. say, scheme, and they're quite similar.
Uh oh I got a scheme fancy coming on. Pretty powerful little
anybody ever gave a damn about it. Still would have had a blast writingSBBS
scripts with it, if that were possible.
---
þ Synchronet þ Hot babes us Nostalgia BBS! -- nostalgia.hellskitchen.org
Sysop: | Tandy |
---|---|
Location: | New York, USA |
Users: | 15 |
Nodes: | 13 (0 / 13) |
Uptime: | 65:45:26 |
Calls: | 335 |
Messages: | 113,200 |