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
COMPARE_ARS Handle c:\sbbs\data\call.dat
If True
Goto end
end_if
FOPEN FILE O_WRONLY|O_CREAT|O_APPEND "%Jcalls.dat"COMPARE_ARS is for comparing the current user against a list of access requirements (not a file), so not the right function to call.
:end
COMPARE is probably what you want. So, FOPEN, FREAD, COMPARE the result against _USERON.ALIAS (a global variable), FWRITE to add it to the file. That's the basics anyway. I think echicken already gave you a working example in the other sub.
Sysop: | digital man |
---|---|
Location: | Riverside County, California |
Users: | 1,043 |
Nodes: | 15 (0 / 15) |
Uptime: | 47:45:50 |
Calls: | 500,902 |
Calls today: | 5 |
Files: | 109,370 |
D/L today: |
7,079 files (941M bytes) |
Messages: | 304,286 |