• GETSTR

    From Willowolf@VERT/WOLFGROT to All on Saturday, January 12, 2002 18:07:00
    I have been writing some Baja modules for my BBS, and I have had a lot of luck with it so far. I have been able to do everything as I have wanted except 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 as 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:

    name - comment - time
    name two - comment - time
    name three - comment - time

    I would have:

    name - comment - time
    name two - comment - time
    name three - comment - time

    I would like it to lign up nicely and not be left up to the length of the STR entered.

    Thanks,
    \\/

    ---
    þ Synchronet þ Wolf Grotto = Las Vegas, Nevada USA = wolfgrotto.darktech.org
  • From Amcleod@VERT to Willowolf on Wednesday, January 16, 2002 09:23:48
    RE: GETSTR
    BY: Willowolf to All on Sun Jan 13 2002 02:07 am

    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:

    Use PRINTF instead of PRINT and you should not have any troubles.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to Willowolf on Wednesday, January 16, 2002 18:46:57
    RE: GETSTR
    BY: Willowolf to All on Sun Jan 13 2002 02:07 am

    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:

    printf "%40s" str

    -Rob

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Willowolf@VERT/WOLFGROT to Digital Man on Wednesday, January 16, 2002 23:00:00
    [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, even 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

    Thanks,
    \\/

    ---
    þ Synchronet þ Wolf Grotto = Las Vegas, Nevada USA = wolfgrotto.darktech.org
  • From Digital Man@VERT to Willowolf on Thursday, January 17, 2002 04:27:05
    RE: GETSTR
    BY: Willowolf to Digital Man on Thu Jan 17 2002 07:00 am

    [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

    -Rob

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Amcleod@VERT to Willowolf on Thursday, January 17, 2002 10:40:05
    RE: GETSTR
    BY: Willowolf to Digital Man on Thu Jan 17 2002 07:00 am

    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?:

    PRINTF "%-40s" str

    You might wanna try reading the docu.....

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Willowolf@VERT/WOLFGROT to Digital Man on Thursday, January 17, 2002 17:55:00
    [Reply to]: GETSTR
    [Typed by]: Digital Man to Willowolf on Thu Jan 17 2002 12:27 pm

    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

    Right on! :)


    ---
    þ Synchronet þ Wolf Grotto = Las Vegas, Nevada USA = wolfgrotto.darktech.org
  • From Willowolf@VERT/WOLFGROT to Amcleod on Thursday, January 17, 2002 17:56:00
    [Reply to]: GETSTR
    [Typed by]: Amcleod to Willowolf on Thu Jan 17 2002


    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 I have read the docs many times, I guess I skipped over this particular area. I will go through them more closely in the future. I don't want to bother anyone. I have no proir programming knowledge and I tend to come here for expert advise. I am in no way an expert at programming, I am simply a novice if that. I appreciate all your help, and I in no way want to be an annoyance.

    I run a BBS as a hobby, as many of us do, and I just find it fun to be able to mess around with the BBS and all its features that Rob has put into them. Sometimes, I just need a little help that's all, more than the Docs can give, and I know the answer is usually there, it's just a lot easier when one is tierd to come here for the expert knowledge. I know a lot of you code for a living, and I have been working on this particular Baja module for a few days and have put in a lot of my spare time and hours with it. I am sure it's something that would take the experts 10 min to write, but not me, it's a challenge, and sometimes, I just need a little help getting it to go in the direction I want to.

    I appreciate DOVE-Net for this reason, without it, I wouldn't have found the answer so quickly to a lot of my problems. I have been told many times to "read the docs" and I have, believe me. I just come here as a last resort, and what may seem very simple to you, may not be so to me. I don't claim to be all knowing or even to be very smart as many of you are. I just want to have
    a little fun that's all.

    But, I promise, I will try and find the answer in the Docs before I come here and ask in the future. I really do appreciate all the help that everyone has given me. And, as I said, I in no way want to be an annoyance.

    Sincerely,
    \\/

    ---
    þ Synchronet þ Wolf Grotto = Las Vegas, Nevada USA = wolfgrotto.darktech.org
  • From Amcleod@VERT to Willowolf on Thursday, January 17, 2002 22:09:18
    RE: GETSTR
    BY: Willowolf to Amcleod on Fri Jan 18 2002 01:56 am

    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.....

    Don't sweat it -- this is a Friday!

    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...

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Willowolf@VERT/WOLFGROT to Amcleod on Friday, January 18, 2002 23:24:00
    [Reply to]: GETSTR
    [Typed by]: Amcleod to Willowolf on Fri Jan 18 2002 06:09 am

    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...

    No, not much at all really. I've been a PC tech for more than 10 years, but never picked up a programming language. I've dabbled in BASIC back in the days of the Commodore 64, but that was it.

    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?

    Thanks,
    \\/

    ---
    þ Synchronet þ Wolf Grotto = Las Vegas, Nevada USA = wolfgrotto.darktech.org
  • From Amcleod@VERT to Willowolf on Saturday, January 19, 2002 22:09:10
    RE: GETSTR
    BY: Willowolf to Amcleod on Sat Jan 19 2002 07:24 am

    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?

    You realise you have just pressed the "Detonate" button on the ticking
    bomb of the oldest thread on the internet?

    If you have a specific job to do, then that will dictate. example, if you
    want to learn programming SOLELY to make additions/modifications to
    Synchronet modules, then start with JS or BAJA (JS preferably, because
    while not a complete replacement for BAJA *yet* it is probably the
    direction SBBS scripting will go moreso than venerable BAJA. Also it has
    wider scope -- NON-Synchronet use).

    Otherwise, if just learning for academic reasons, don't start by learning anything too esoteric. And don't use anything too crippled. C, Pascal,
    Java would be fairly good introductory languages. Ignore syntactically
    dated and outmoded languages like BASIC, FORTRAN, COBOL <shudder>. If you
    can program in a "good" language you can dumb-down to use BASIC, FORTRAN
    etc, if the need arises. If you are only schooled in VB, then you will be driven insane by Perl.

    Speaking of Perl, it is a FINE language for many tasks, but I don't know
    if it is a good place to start -- it can be extremely cryptic which may
    give the rank beginner a problem. I hesitate to mention Python because it
    goes against 40 years of programing experience and makes "whitespace" syntactically significant and the idea is abhorrent to me. I am all in
    favour of innovation, but this idea sucks dust.

    Many languages will cost you something to acquire. Perl is free
    (ActiveState for the Windows people) Python probably the same. There are
    free versions of compilers for C and Pascal out there.

    My biggest tip to the novice programmer is: get yourself a decent
    text-editor (http://www.utopia-planitia.de/indexus.html) and learn to use
    it.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rocko@VERT/NSTLG to Willowolf on Sunday, January 20, 2002 05:42:00
    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?

    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 is 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.
    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 Programming textbook suggested using Java as the application language, and Perl as a scripting language.
    Now we're on the topic of Perl. It's a very powerful language, to be sure. However, it still holds best for writing scripts. That is, something that doesnt have to be lightning fast, but needs to be developed lightning fast.
    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.
    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 RIT 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!
  • From Amcleod@VERT to Rocko on Sunday, January 20, 2002 14:20:23
    RE: GETSTR
    BY: Rocko to Willowolf on Sun Jan 20 2002 01:42 pm

    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.....

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rocko@VERT/NSTLG to Amcleod on Sunday, January 20, 2002 15:53:00
    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.....

    .....Well since I'm so elite and stuck up, I always know what to expect
    from the Perl functions: It will break the first three times I try to run it and then it will magically work after a tweak or two. =p

    ... He walks down Lover's Lane holding his own hand.
    --- MultiMail/Win32 v0.42
    þ Synchronet þ My Brand-Spanking New Guinea Pig BBS!
  • From Willowolf@VERT/WOLFGROT to Rocko on Monday, January 21, 2002 23:24:00
    [Reply to]: GETSTR
    [Typed by]: Rocko to Willowolf on Sun Jan 20 2002 01:42 pm

    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.

    Great! Another vote to start with Java. I actually have some Java books that were given to me sitting in the corner around here somewhere. I'll have to pick them up and pondr them. I appreciate it. Thanks again!

    \\/

    ---
    þ Synchronet þ Wolf Grotto = Las Vegas, Nevada USA = wolfgrotto.darktech.org
  • From Digital Man@VERT to Willowolf on Tuesday, January 22, 2002 05:58:43
    RE: GETSTR
    BY: Willowolf to Rocko on Tue Jan 22 2002 07:24 am

    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.

    Just to clarify, Java and JavaScript are two very different things. Java is a language and a run-time environment devloped by Sun. JavaScript is strictly a 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.

    -Rob

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Darqualan@VERT/DARKRLM to Digital Man on Tuesday, January 22, 2002 15:43:00
    RE: GETSTR
    BY: Digital Man to Willowolf on Tue Jan 22 2002 01:58 pm

    There is one other difference between Javascript and Java, Javascript is easier to work with and the synax is quite different from what we worked on in college.



    ---
    þ Synchronet þ Dark Realm BBS - Darkrealm.darktech.org
  • From Tracker1@VERT to All on Tuesday, January 22, 2002 18:01:30
    Actually, JS is a VERY good place to start, you can test functionality
    in Synchronet, in Client-Side browsers, and Server-Side ASP...

    The syntax is close to C++/Java which make the transition to these a
    bit easier.. and also allow you to learn programming concepts without
    the need to learn a more complex language. VB is also a fairly good
    place, since it supports most object oriented concepts (more in vb.net).

    But if you want to do anything outside of windows, avoid VB, it's easier
    to pick up if you know another language anyways.

    =======================================================================
    Michael J. Ryan - tracker1@theroughnecks.com
    aim: aztrackr1 - icq: 4935386 - Y!: tracker_1.rm - msn: see email =======================================================================
    One program for aim/icq/yahoo/msn - http://www.trillian.cc/


    "Rocko" <Rocko@NSTLG> wrote in message news:1352...
    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?

    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
    is
    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.
    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
    Programming
    textbook suggested using Java as the application language, and Perl as a scripting language.
    Now we're on the topic of Perl. It's a very powerful language, to be
    sure.
    However, it still holds best for writing scripts. That is, something that doesnt have to be lightning fast, but needs to be developed lightning
    fast.
    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.
    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
    RIT
    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!


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rocko@VERT/NSTLG to Darqualan on Wednesday, January 23, 2002 01:46:00
    RE: GETSTR
    BY: Darqualan to Digital Man on Tue Jan 22 2002 11:43 pm

    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.

    In the grander scheme of things, they're pretty close. I understand that for a Java app to launch it needs a main method contained in an object, and that's the big difference right away.
    However, compare it to.. say, scheme, and they're quite similar.

    Uh oh I got a scheme fancy coming on. Pretty powerful little language, if anybody ever gave a damn about it. Still would have had a blast writing SBBS scripts with it, if that were possible.
    ---
    þ Synchronet þ Hot babes us Nostalgia BBS! -- nostalgia.hellskitchen.org
  • From Willowolf@VERT/WOLFGROT to Digital Man on Tuesday, January 22, 2002 23:29:00
    [Reply to]: GETSTR
    [Typed by]: Digital Man to Willowolf on Tue Jan 22 2002 01:58 pm

    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.

    I understand. Thanks Rob.


    ---
    þ Synchronet þ Wolf Grotto = Las Vegas, Nevada USA = wolfgrotto.darktech.org
  • From Tracker1@VERT to All on Thursday, January 24, 2002 04:18:20
    Nod, would be cool to allow various scripting contexts, as a scripting environment that uses the various runtimes, kind of like ms does to allow
    js, vbs, ps etc for asp, or wsh.

    I like js, and think it is about my fav language though.. also, defining classes is different, in js it is done by declaring a variable's property to
    a function designed as a class. See below for example.. Most people don't
    know that JS can be used this way, as well as calling other functions, or assigning functions as properties.

    JS is actually a pretty complete language, you need to have objects for the run-time context (Synchronet), but it's really cool.

    -------------
    function MCAlert(inName,inValue,inMore) {
    alert(inName + ": " + inValue);
    }

    function MyClass(inName,inValue) {
    this.name = inName;
    this.value = inValue;
    this.alert = new Function("inMore","return MCAlert(this.name,this.value,inMore)");
    }

    var arrMC_Info = new Array()
    arrMC_Info[0] = new MyClass("location","phoenix")

    //now you can reference
    for (var i=0; i<arrMC_Info.length; i++) {
    //print(arrMC_Info[i].name)
    //print(arrMC_Info[i].value)
    }



    =======================================================================
    Michael J. Ryan - tracker1@theroughnecks.com
    aim: aztrackr1 - icq: 4935386 - Y!: tracker_1.rm - msn: see email =======================================================================
    One program for aim/icq/yahoo/msn - http://www.trillian.cc/


    "Rocko" <Rocko@NSTLG> wrote in message news:1361...
    RE: GETSTR
    BY: Darqualan to Digital Man on Tue Jan 22 2002 11:43 pm

    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.

    In the grander scheme of things, they're pretty close. I understand
    that
    for a Java app to launch it needs a main method contained in an object,
    and
    that's the big difference right away.
    However, compare it to.. say, scheme, and they're quite similar.

    Uh oh I got a scheme fancy coming on. Pretty powerful little
    language, if
    anybody ever gave a damn about it. Still would have had a blast writing
    SBBS
    scripts with it, if that were possible.
    ---
    þ Synchronet þ Hot babes us Nostalgia BBS! -- nostalgia.hellskitchen.org

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net