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
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 :)
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
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. :-)
https://bbs.electronicchicken.com/temp/calls.js.txt
It's always fun to make Baja look bad. :-)
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.
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
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. :-)
I still use baja for some stuff.
Sysop: | Ragnarok |
---|---|
Location: | Dock Sud, Bs As, Argentina |
Users: | 136 |
Nodes: | 10 (0 / 10) |
Uptime: | 45:38:43 |
Calls: | 15,173 |
Calls today: | 2 |
Files: | 19,862 |
D/L today: |
24 files (4,260K bytes) |
Messages: | 1,693,161 |