• Correct BAJA Command

    From DesotoFireflite@VERT/VALHALLA to All on Wed Dec 13 14:06:48 2017
    Need some help on a baja compare statement. I want to compare a current users name (Handle) with the last entry of a file im keeping created by baja.

    I'll use me as an example

    What I want is if I was the last entry "Desotofireflite" in the log file called call.dat, I want it to do nothing, but if I wasn't the last entry in the call.dat, I want it to write to the call.dat my name. My problems is I don't know how to compare a handle to the last entry of a file. My guess would be

    COMPARE_ARS Handle c:\sbbs\data\call.dat
    If True
    Goto end
    end_if

    FOPEN FILE O_WRONLY|O_CREAT|O_APPEND "%Jcalls.dat"

    :end

    Thanks in advance. Lost in baja hell :)

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Play Trade Wars Between 10 Other BBS's On Valhalla's Trade Wars Game Server!

    Featuring Legion, A New RPG, Available On Both Systems!

    --- Old farts never die! They just smell that way...
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From echicken@VERT/ECBBS to DesotoFireflite on Wed Dec 13 16:42:35 2017
    Re: Correct BAJA Command
    By: DesotoFireflite to All on Wed Dec 13 2017 14:06:48

    What I want is if I was the last entry "Desotofireflite" in the log file called call.dat, I want it to do nothing, but if I wasn't the last entry in the call.dat, I want it to write to the call.dat my name. My problems is I don't know how to compare a handle to the last entry of a file. My guess would be

    COMPARE_ARS Handle c:\sbbs\data\call.dat

    COMPARE_ARS evaluates the current user's status against a given Access Requirements String, eg. 'COMPARE_ARS LEVEL 60 AND REST NOT Q'. What you want is simply 'COMPARE x y' where the equality of 'x' and 'y' will be evaluated.

    To get the last line, you'll have to read the file line by line until EOF. (Unless there's some handy way of doing this in Baja that I don't know.) That will require some use of Baja's FEOF and FREAD_LINE functions.

    I'm not sure if this is quite what you're aiming at, but it should be enough to get you started:

    https://bbs.electronicchicken.com/temp/calls.src.txt

    I imagine the above could be simplified a little bit. For fun, here's the same result achieved in JS:

    https://bbs.electronicchicken.com/temp/calls.js.txt

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Digital Man@VERT to DesotoFireflite on Wed Dec 13 13:48:06 2017
    Re: Correct BAJA Command
    By: DesotoFireflite to All on Wed Dec 13 2017 02:06 pm

    Need some help on a baja compare statement. I want to compare a current users name (Handle) with the last entry of a file im keeping created by baja.

    I'll use me as an example

    What I want is if I was the last entry "Desotofireflite" in the log file called call.dat, I want it to do nothing, but if I wasn't the last entry in the call.dat, I want it to write to the call.dat my name. My problems is I don't know how to compare a handle to the last entry of a file. My guess would be

    COMPARE_ARS Handle c:\sbbs\data\call.dat
    If True
    Goto end
    end_if

    FOPEN FILE O_WRONLY|O_CREAT|O_APPEND "%Jcalls.dat"

    :end

    Thanks in advance. Lost in baja hell :)

    It's so rare to get a Baja programming question these days. Could I trouble you to re-ask the question in the DOVE-Net / Baja Programming sub-board? It's in dire need of existential justification. :-)

    digital man

    This Is Spinal Tap quote #40:
    Morty the Mime: Come on, don't talk back, mime is money, come on, move it. Norco, CA WX: 82.4øF, 7.0% humidity, 4 mph NW wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to echicken on Wed Dec 13 13:50:02 2017
    Re: Correct BAJA Command
    By: echicken to DesotoFireflite on Wed Dec 13 2017 04:42 pm

    I imagine the above could be simplified a little bit. For fun, here's the same result achieved in JS:

    https://bbs.electronicchicken.com/temp/calls.js.txt

    It's always fun to make Baja look bad. :-)


    digital man

    This Is Spinal Tap quote #44:
    It really, it does disturb me, but i'll rise above it; I'm a professional. Norco, CA WX: 82.4øF, 7.0% humidity, 4 mph NW wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From MRO@VERT/BBSESINF to Digital Man on Wed Dec 13 15:55:14 2017
    Re: Correct BAJA Command
    By: Digital Man to echicken on Wed Dec 13 2017 01:50 pm

    Re: Correct BAJA Command
    By: echicken to DesotoFireflite on Wed Dec 13 2017 04:42 pm

    I imagine the above could be simplified a little bit. For fun, here's the same result achieved in JS:

    https://bbs.electronicchicken.com/temp/calls.js.txt

    It's always fun to make Baja look bad. :-)

    yes, in that case you can do it in less lines with .js than baja
    ---
    þ Synchronet þ ::: BBSES.info - free BBS services :::
  • From KK4QBN@VERT/KK4QBN to Digital Man on Wed Dec 13 18:42:11 2017
    Re: Correct BAJA Command
    By: Digital Man to echicken on Wed Dec 13 2017 13:50:02

    https://bbs.electronicchicken.com/temp/calls.js.txt

    It's always fun to make Baja look bad. :-)

    Hey, I like Baja.. I've always it was much more powerful than any other BBS could dare come out with, until yall roled out the red carpet on JS...


    I still use baja for some stuff.

    --

    Tim Smith (KK4QBN)
    KK4QBN BBS

    ---
    * Synchronet * KK4QBN BBS - kk4qbn.com - kk4qbn.synchro.net - Chatsworth GA USA
  • From Nightfox@VERT/DIGDIST to KK4QBN on Wed Dec 13 17:13:38 2017
    Re: Correct BAJA Command
    By: KK4QBN to Digital Man on Wed Dec 13 2017 06:42 pm

    It's always fun to make Baja look bad. :-)

    Hey, I like Baja.. I've always it was much more powerful than any other BBS could dare come out with, until yall roled out the red carpet on JS...

    I still use baja for some stuff.

    I tend to prefer JS. I think JS is easier to read and more powerful than Baja. I used Baja for a couple things, but once I started writing mods in JS, I haven't looked back. One of my old Baja things was my original custom command shell, but I've long since converted that to JavaScript.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From DesotoFireflite@VERT/VALHALLA to echicken on Thu Dec 14 05:42:27 2017
    Re: Correct BAJA Command
    By: echicken to DesotoFireflite on Wed Dec 13 2017 04:42 pm

    COMPARE_ARS evaluates the current user's status against a given Access Requirements String, eg. 'COMPARE_ARS LEVEL 60 AND REST NOT Q'. What you want is simply 'COMPARE x y' where the equality of 'x' and 'y' will be evaluated.

    To get the last line, you'll have to read the file line by line until EOF. (Unless there's some handy way of doing this in Baja that I don't know.) That will require some use of Baja's FEOF and FREAD_LINE functions.

    I'm not sure if this is quite what you're aiming at, but it should be enough to get you started:

    https://bbs.electronicchicken.com/temp/calls.src.txt

    OK, thanks. I think I see what you were doing, and I think I can incorporate this into my baja script, anyway, I'm gonna try. Thanks. I've really got to learn js, it really seems to get things done so much simpler.

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Play Trade Wars Between 10 Other BBS's On Valhalla's Trade Wars Game Server!

    Featuring Legion, A New RPG, Available On Both Systems!

    --- SENILE.COM found...Out of Memory...
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From DesotoFireflite@VERT/VALHALLA to Digital Man on Thu Dec 14 05:45:03 2017
    Re: Correct BAJA Command
    By: Digital Man to DesotoFireflite on Wed Dec 13 2017 01:48 pm

    It's so rare to get a Baja programming question these days. Could I trouble you to re-ask the question in the DOVE-Net / Baja Programming sub-board? It's in dire need of existential justification. :-)

    Sure, I'll be glad to. I think I have the answer I was looking for, but I'm always open to different ideas. Thanks

    SysOp: C.G. Learn, AKA: DesotoFireflite
    Valhalla Home Services! - (Synchronet) - bbs.valhallabbs.com
    Valhalla II! - (GAP) - bbs.valhallabbs.com:24
    A Gamers Paradise - Over 150 Registered Online Game Doors!

    Play Trade Wars Between 10 Other BBS's On Valhalla's Trade Wars Game Server!

    Featuring Legion, A New RPG, Available On Both Systems!

    --- FART(n): An audio test of one's waste-disposal system.
    þ Synchronet þ Valhalla Home Services þ USA þ http://valhalla.synchro.net
  • From Daryl Stout@VERT/TBOLT to KK4QBN on Thu Dec 14 10:13:00 2017
    Tim,

    I still use baja for some stuff.

    I always thought Baja was the lower peninsula of California. <G>

    Daryl

    ---
    þ OLX 1.53 þ All those updates, and still imperfect!!!
    þ Synchronet þ The Thunderbolt BBS - wx1der.dyndns.org