• variable

    From altere@VERT/DARKDIM to All on Wed Dec 27 14:21:00 2000
    Hrm. Is there easier way to set a variable with the total amount of credits a user has rather then reading from xtrn.dat or some other drop file?

    Currently I have it reading xtrn.dat and taking the credits line and that my 'credits' variable, is there any other way to do this?

    ---
    þ Synchronet þ Dark Dimension ááS ú telnet://dark.dimension-bbs.com ú Hit Me!
  • From Digital Man@VERT to altere on Wed Dec 27 12:22:30 2000
    RE: variable
    BY: altere to All on Wed Dec 27 2000 02:21 pm

    Hrm. Is there easier way to set a variable with the total amount of credits user has rather then reading from xtrn.dat or some other drop file?

    Currently I have it reading xtrn.dat and taking the credits line and that my 'credits' variable, is there any other way to do this?

    Use the global variable: _USERON.CDT

    If you want to modify the user's credits, then use the function: ADJUST_USER_CREDITS

    Rob

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From altere@VERT/DARKDIM to Digital Man on Thu Dec 28 01:00:00 2000
    RE: variable
    BY: Digital Man to altere on Wed Dec 27 2000 12:22 pm

    Use the global variable: _USERON.CDT

    If you want to modify the user's credits, then use the function: ADJUST_USER_CREDITS

    hrm, the adjust_user_credits won't work for what I'm doing as the amount of credits isn't ever the same, it's based on some things the user enters. Having said that I wanted to have a credits variable and add, mul, or whatever the user enters against that variable.

    ---
    þ Synchronet þ Dark Dimension ááS ú telnet://dark.dimension-bbs.com ú Hit Me!
  • From altere@VERT/DARKDIM to All on Thu Dec 28 11:16:00 2000
    RE: variable
    BY: altere to Digital Man on Thu Dec 28 2000 01:00 am

    Use the global variable: _USERON.CDT

    If you want to modify the user's credits, then use the function: ADJUST_USER_CREDITS

    hrm, the adjust_user_credits won't work for what I'm doing as the amount of credits isn't ever the same, it's based on some things the user enters. Hav

    Alright, perhaps some help with this.. This is just a piece of it and I've limited some things for testing.. Basically it asks for a few numbers from the user and add's subtracts, etc... Now, real basic here without adding or subtracting.

    int a_credit u_level mod_file
    set a_credit 10

    fopen mod_file O_CREAT|O_WRONLY "%nmoduser.dat"
    if_false
    print "error\r\n"
    return
    end_if

    fwrite mod_file a_credit
    fclose mod_file

    Now, this obviously creates the moduser.dat (i've verified) but it's just putting a blank line in there rather then 10. Now if the credit adjustment were going to be the same everytime then I would use adjust_credits but that isn't the case, a_credit will ALWAYS be different, I just set it to 10 for testing purposes. Any ideas? Oh, ignore u_level, once I fix a_credit I can fix u_level; I've commented out the level info so that what I'm showing here is actualy what I'm working with.




    ---
    þ Synchronet þ Dark Dimension ááS ú telnet://dark.dimension-bbs.com ú Hit Me!
  • From Amcleod@VERT to altere on Thu Dec 28 12:12:08 2000
    RE: variable
    BY: altere to All on Thu Dec 28 2000 11:16 am

    set a_credit 10
    fwrite mod_file a_credit

    It's been a looong time, but:

    1) Doesn't FWRITE output the integer in BINARY?
    2) On Little-endian (Intel-type) boxes, don't the low-order bytes come first? 3) With A_CREDIT set to "10" isn't that 0A 00 00 00 (in hex)?
    4) Isn't that equivilent to a LINEFEED followed by three NULLS?
    5) Didn't you say the file contained only a linefeed?

    I'd check the BAJA documentation looking for a verb called "FPRINT" and see if it did something different to "FWRITE" if I were you.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Digital Man@VERT to altere on Thu Dec 28 13:48:57 2000
    RE: variable
    BY: altere to Digital Man on Thu Dec 28 2000 01:00 am

    Use the global variable: _USERON.CDT

    If you want to modify the user's credits, then use the function: ADJUST_USER_CREDITS

    hrm, the adjust_user_credits won't work for what I'm doing as the amount of credits isn't ever the same, it's based on some things the user enters. Hav said that I wanted to have a credits variable and add, mul, or whatever the user enters against that variable.

    ADJUST_USER_CREDITS supports integer variables. Example:

    int i
    set i 10
    adjust_user_credits i

    You can modify _USERON.CDT as it is a read-only variable.

    Rob

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From PistolGrip@VERT/WASTELND to Digital Man on Thu Dec 28 19:51:00 2000
    RE: variable
    BY: Digital Man to altere on Thu Dec 28 2000 01:48 pm

    You can modify _USERON.CDT as it is a read-only variable.

    Should that be "can not" modify? :-)

    PG

    ---
    þ Synchronet þ WasteLand BBS þ telnet://wasteland.darktech.org
  • From altere@VERT/DARKDIM to Amcleod on Fri Dec 29 09:16:00 2000
    RE: variable
    BY: Amcleod to altere on Thu Dec 28 2000 12:12 pm

    1) Doesn't FWRITE output the integer in BINARY?
    I'd check the BAJA documentation looking for a verb called "FPRINT" and see it did something different to "FWRITE" if I were you.

    *CLUEBAT* Um, ok.. I should have noticed that. I'm going to go hide in my corner now. :)

    ---
    þ Synchronet þ Dark Dimension ááS ú telnet://dark.dimension-bbs.com ú Hit Me!
  • From altere@VERT/DARKDIM to Digital Man on Fri Dec 29 09:17:00 2000
    RE: variable
    BY: Digital Man to altere on Thu Dec 28 2000 01:48 pm

    ADJUST_USER_CREDITS supports integer variables. Example:

    I'll have to try this again with this method. Beats opening moduser.dat, but it didn't work for me the last time I tried it this way; I'll double check some things but either way I have a solution now. Thanks!

    ---
    þ Synchronet þ Dark Dimension ááS ú telnet://dark.dimension-bbs.com ú Hit Me!
  • From Digital Man@VERT to PistolGrip on Sat Dec 30 02:31:04 2000
    RE: variable
    BY: PistolGrip to Digital Man on Thu Dec 28 2000 07:51 pm

    You can modify _USERON.CDT as it is a read-only variable.

    Should that be "can not" modify? :-)

    Correct. _USERON.CDT CANNOT be modified (it is a read-only variable).

    Rob

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