• The CompuBBS code (4/4)

    From SPP@21:1/5 to All on Mon Jul 26 22:49:45 2021
    [continued from previous message]

    do enterbreak with tcseq , tcport, tcuser,
    tctoken, xbuy_sell, tcshares , tcmatch ,tcstock
    , tcprice , tcmmid , xreason , tcmisc ,
    tcclearing , xshort

    case tcommand = "M"

    tctype = substr( ptm , 2 , 1 )

    do case

    case tctype = "S" && Stock maintence

    tport = substr( ptm , 3 , 6 )
    tuser = substr( ptm , 9 , 4 )
    ttoken = substr( ptm , 13 , 10 )

    tcstock = substr( ptm , 23 , 6 )

    tcshorttype = substr( ptm , 29 ,
    1 ) tcblocksub = substr( ptm ,
    30 , 1 ) tccenter = substr( ptm
    , 31 , 1 ) tcmisc = substr( ptm
    , 32 , 4 )

    do entermaint with tport, tuser,
    ttoken, tcstock , tcshorttype ,
    tcblocksub , tccenter , tcmisc

    case tctype = "A" && Account settings

    taccount = substr( ptm , 3 , 6 )
    tpassword = substr( ptm , 9 , 10
    ) ttest = substr( ptm , 19 , 1 )
    ttrusted = substr( ptm , 20 , 1
    ) tthresh = val( substr( ptm ,
    21 , 6 ) ) tsscheck = substr(
    ptm , 27 , 1 ) tiflag = substr(
    ptm , 28 , 1 ) tdefault =
    substr( ptm , 29 , 4 )

    do enteraccount with taccount,
    tpassword, ttest , ttrusted ,
    tthresh, tsscheck, tiflag,
    tdefault

    case tctype = "F" && Account settings

    taccount = substr( ptm , 3 , 6 )
    tmmid = substr( ptm , 9 , 4 )
    tclearing = substr( ptm , 13 , 1
    )

    do enterfirm with taccount,
    tmmid, tclearing

    case tctype = "T" && Stock state

    tport = substr( ptm , 3 , 6 )
    tuser = substr( ptm , 9 , 4 )
    ttoken = substr( ptm , 13 , 10 )

    tcstock = substr( ptm , 23 , 6 )

    tcstate = substr( ptm , 29 , 1 )

    do enterstate with tport, tuser,
    ttoken, tcstock , tcstate

    otherwise

    ? time()+" Unvalid maint reason
    = "+tctype


    endcase

    otherwise

    do alert with "Unknown command"+ptm

    endcase

    return

    proc sendeos

    s = "E" call int99 with s

    if s # "f" .and. s # "b"

    activate window output

    ? time() +" !!!! ERROR ON EOS WRITE!!!!!!"

    ? ws

    activate window ticker

    suspend

    endif

    return


    proc flush

    s = "F" call int99 with s if s # "f" ? "!!!!ERROR ON FLUSH!!!!"

    do alert with "Error on flush:"+werror(s) suspend endif

    gstoredflag = .F.

    return

    proc shutdown

    do alert with "Shutdown initiated"

    if !geom && Shutting down too early? Just in case...

    wait window "Can't end day, EOM has not happened yet!"
    nowait

    do alert with "Ending day attempted before EOM time!"

    return

    endif


    sdk = chr( (rand() * 25) + asc("A") )

    wait window "Initiate Shutdown by pressing ["+sdk+"] within 10
    seconds" to sdh timeout 10

    if upper( sdh ) # sdk

    wait window "Shutdown Aborted" nowait

    do alert with "Shutdown aborted"

    return

    endif

    wait window "Confirm Shutdown by pressing the magic key within
    10 seconds" to sdh timeout 10

    if upper( sdh ) # "M"

    wait window "Inccorect Shutdown confirmation" nowait

    do alert with "Incorrect shutdown magic key"

    return

    endif

    do alert with "Shutdown confirmed"

    if file( mholdofffile )

    ? "Holdoff file exists! Escalate!" suspend

    else

    sdf = fcreate( mholdofffile ) =fputs( sdf , "Stop in the
    name of love!") =fclose( sdf )

    endif

    if !file( mholdofffile )

    wait window "No HOLDOFF file created, aborting Shutdown"
    nowait

    do alert with "No HOLDOFF file created, aborting
    shutdown"

    return

    endif

    wait window "Shutting down..." nowait

    do swrite with "N" , "" wait window "Shutting down... 3" timeout
    1

    do swrite with "N" , "" wait window "Shutting down... 2" timeout
    1

    do swrite with "N" , "" wait window "Shutting down... 1" timeout
    1

    do flush

    wait window "Flushing..." timeout 1

    do sendeos do flush

    wait window "Sending End of Session... 3" timeout 1 do flush

    wait window "Sending End of Session... 2" timeout 1 do flush

    wait window "Sending End of Session... 1" timeout 1 do flush

    wait window "Sending End of Session... 0" timeout 1 do flush

    mdone = .T.

    zap

    return


    proc pingreply param preply , ptm

    ptoken = substr( ptm , 2 , 12 ) pport = substr( ptm , 14 , 4 )

    x = "R"+ptoken+str( tseq ,9,0)+str( tmatch ,9,0)+str(0,9,0)


    s = "S"+chr(len(x))+ preply+pport+ x call int99 with s

    return


    proc seteventflags param secode

    do case

    case secode = "SOD"

    gaccept = .T. gactaccept = .T.

    case secode = "EOA"

    gactaccept = .F.

    case secode = "EOD"

    gaccept = .F.

    case secode = "EOM"

    geom = .T. endcase

    return

    proc alert parameter s xs = dtoc(date())+" "+time() +"-"+ s

    ? xs

    IF FILE( malertfile ) && Does file exist? errfile = FOPEN(
    malertfile ,12) && If so, open read/write
    ELSE errfile = FCREATE( malertfile ) && If not create it ENDIF

    IF errfile < 0 && Check for error opening file WAIT 'Cannot open
    or create output file' WINDOW NOWAIT
    ELSE && If no error, write to file =fseek( errfile, 0 , 2 )
    =FWRITE(errfile, xs + chr(13) + chr(10) )
    ENDIF

    =FCLOSE(errfile) && Close file

    * ? chr(07)+chr(07)+chr(07)+chr(07) return ----------------------------------------------------------------------------- MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMWNXKKKKXXNWMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMN0xoc;'..'::,..',:lxOXWMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMWKd:'. ;kXXO:. .;d0WMMMMMMMMMMMMMMM
    MMMMMMMMMMMMMNk:. ;kNMMMMWO, .;dXMMMMMMMMMMMMM
    MMMMMMMMMMMNx, ;kNMMMMMMXd' .oXMMMMMMMMMMM
    MMMMMMMMMWO; ;kNMMMMMX0d' 'kNMMMMMMMMM
    MMMMMMMMNd. ;kNMMMMMXd'. .:d:. .lXMMMMMMMM
    MMMMMMMNo. ;kNMMMMMXd' .:OWMWO:. cXMMMMMMM
    MMMMMMWd. .xWMMMMXo' . ;0WMMMMWO:. lNMMMMMM
    MMMMMMO' .:OWXo. .d0: .lKWMMMMWO:. .xMMMMMM
    MMMMMWl '' .,. lNMO. .lKWMMMMWO:. :NMMMMM
    MMMMMX; ;kNNx' ,KMMWo. .lKWMMMMWO:. '0MMMMM
    MMMMMK,.dNMMMMXd' .lKWMMMNk, .lKMMMMMWk..OMMMMM
    MMMMMK, ,xNMMMMMNx' .:kK0kxdxO00o' .lKWMNk;..OMMMMM
    MMMMMN: ,xNMMMMMXx' .,'. ..'' .ld; ,KMMMMM
    MMMMMMx. ,xNMMMMMXd' .oOo. oWMMMMM
    MMMMMMN: ,xNMMMMMXd. .oXMMWKo. ,KMMMMMM
    MMMMMMM0, ,xNMMMW0; .oKMMMMMNk' .OMMMMMMM
    MMMMMMMM0, ,xX0c. .oXMMMMMNk; .OWMMMMMMM
    MMMMMMMMMXc. .. .oOKWMMMMNk; ;0WMMMMMMMM
    MMMMMMMMMMWk, .oXMMMMMMNk; 'xNMMMMMMMMMM
    MMMMMMMMMMMMNx;. '0MMMMMMNk; ,dXMMMMMMMMMMMM MMMMMMMMMMMMMMW0o,. ,xNMMNk; 'lkNMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMW0xl,.. ,lo; ..,cdONMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMWX0Oxdoooooodxk0XWMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ----------------------------------------------------------------------------- Political Swastika ascii ............................................................ ............................................................ .....................';cloddxxxxxdolc;,..................... ................';ldOKXWMMMMMMMMMMMMWXKOdl;'................ ..............;oOXWMMMMMMMMXd::dXMMMMMMMMWXko;.............. ...........':xXWMMMMMMMMMXx' 'dXMMMMMMMMMWXx:'........... ..........:kNMMMMMMMMMMXd' ,OMMMMMMMMMMMMNk:.......... ........,oXMMMMMMMMMMXd' 'dXMMMMMMMMMMMMMMMXo,........ .......;kNMMMMMMMMMXd' 'dOXMMMMMXxxXMMMMMMMMMNk;....... ......;kWMMMMMMMMXd' 'dXMMMMMMXd' 'dXMMMMMMMMWk;...... .....,xWMMMMMMMMNo. 'OMMMMMMXd' 'dXMMMMMMMWx,..... .....lXMMMMMMMMMMXd' 'dXMMXd' 'dXMMMMMMXl..... ....,kMMMMMXOXMMMMMXd' 'c:' .. 'dXMMMMMk,....
    ....:0MMMXd' 'dXMMMMMXd' 'dXXd' 'dXMMM0:....
    ....cKMM0, 'dXMMMMMXl. .lXMMMMXd' ,0MMKc....
    ....:KMMXd' 'dXMMXd' 'dXMMMMMXd' 'dXMMK:....
    ....;OMMMMXd' 'oo' . 'dXMMMMMXd:dXMMMMO;....
    ....'dWMMMMMXd' 'd00d' 'dXMMMMMWMMMMMWd'....
    .....:0MMMMMMMXd' 'dXMMMMXd. 'xNMMMMMMMMM0;..... ......lXMMMMMMMMXd' 'dXMMMMMMXo. 'xNMMMMMMMMXl...... ......'lXMMMMMMMMMXd,,dXMMMMMXOd' 'dXMMMMMMMMMXl'...... .......'c0WMMMMMMMMMNNMMMMMXd' 'dXMMMMMMMMMW0c........ .........;xXMMMMMMMMMMMMMXd' 'dXMMMMMMMMMMXx;......... ..........':kNMMMMMMMMMMMO, 'dXMMMMMMMMMWXk:'.......... ............':d0NMMMMMMMMMXd' 'dXMMMMMMMMMN0d:'............ ...............,cdOXWMMMMMMMXOOXMMMMMMMWXOdc,............... ..................';coxk0KKXXNXXXKK0kxoc;'.................. ........................',,;;;;;;,,'........................ ............................................................ ............................................................ ----------------------------------------------------------------------------- Sig : "The nature of the good is to overcome and defeat the bad."



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice



    --
    "The nature of the good is to overcome and defeat the bad." - divine voice

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)