Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

WAR (card game)

BravoknightBravoknight Member Posts: 35
ok, im having a lot of trouble with my program, what im trying to do is creat a log book for a class in school, and what im having trouble with is adding a student to the log. if u guys could help me, what i wanna do is make it so that they can add a student and he will be saved in an array with his info

Comments

  • slicer69slicer69 Member Posts: 272
    First, what language? Do you have any done? If so, please send in some source code for us to look at:


    : ok, im having a lot of trouble with my program, what im trying to do is creat a log book for a class in school, and what im having trouble with is adding a student to the log. if u guys could help me, what i wanna do is make it so that they can add a student and he will be saved in an array with his info
    :


  • BravoknightBravoknight Member Posts: 35

    [b]
    File Edit View Search Run Debug Calls Options Help
    +--------------------------------- BLACH.BAS
    SCREEN 12
    LINE (0, 0)-(630, 460), 15, B
    LINE (1, 1)-(629, 459), 15, B
    LOCATE 12, 30: PRINT "Community Service"
    LOCATE 13, 30: PRINT "Log Book"
    LOCATE 14, 30: PRINT "Created By:Gunnery Sergeant Jennings"
    LOCATE 15, 41: PRINT "Staff Sergeant Wind"
    LOCATE 16, 30: PRINT "(C) 2002"
    SLEEP
    menu:
    CLS
    LINE (0, 0)-(630, 460), 1, B
    LINE (1, 1)-(629, 459), 1, B
    LOCATE 5, 5
    PRINT "Add New Cadet"
    LOCATE 7, 5
    PRINT "Delete Cadet"
    LOCATE 9, 5
    PRINT "Delete All Cadets" LOCATE 11, 5
    PRINT "Add Community Service Time For Cadet"
    LOCATE 13, 5
    PRINT "List Cadets"
    LOCATE 15, 5
    PRINT "Search For Cadet"
    LOCATE 17, 5
    PRINT "Help"
    LOCATE 19, 5
    PRINT "Credits"
    LOCATE 21, 5
    PRINT "Quit"
    LOCATE 23, 5
    PRINT "Setup"
    a=65
    DO
    getkey$ = INKEY$
    LINE (6, a - 2)-(625, a + 14), 9, B
    LINE (5, a - 1)-(626, a + 13), 9, B
    IF getkey$ = CHR$(0) + CHR$(80) THEN
    LINE (6, a - 2)-(625, a + 14), 0, B
    LINE (5, a - 1)-(626, a + 13), 0, B
    a = a + 32
    END IF
    IF getkey$ = CHR$(0) + CHR$(72) THEN
    LINE (6, a - 2)-(625, a + 14), 0, B
    LINE (5, a - 1)-(626, a + 13), 0, B
    a = a - 32
    END IF
    IF a = 33 THEN a = 353
    IF a = 385 THEN a = 65
    IF getkey$ = CHR$(32) THEN GOTO enter:
    LOOP




    enter:
    IF a = 65 GOTO add
    'IF a = 97 GOTO delete
    'IF a = 129 GOTO deleteall
    'IF a = 161 GOTO addtime
    'IF a = 193 GOTO listcadets
    'IF a = 225 GOTO search
    IF a = 257 GOTO help
    IF a = 289 GOTO credits
    IF a = 321 GOTO quit
    IF a = 353 GOTO setup







    setup:
    DIM cadetinfo(4, 200)
    DIM info(1)
    OPEN "cslog.sav" FOR OUTPUT AS #1
    FOR counter1 = 1 TO 4
    FOR counter2 = 1 TO 200
    WRITE #1, cadetinfo(counter1, counter2)
    NEXT
    NEXT
    WRITE #1, info(1)
    CLOSE #1
    PRINT info
    SLEEP
    SLEEP
    SLEEP
    GOTO menu
    SLEEP

    quit:
    END

    credits:
    CLS
    PRINT "Created By:Gunnery Sergeant Jennings and Staff Sergeant Wind"
    PRINT "Community Service Log Book Computer Software"
    PRINT "2002"
    SLEEP
    GOTO menu

    help:
    CLS
    PRINT "To Navigate Through The Program Use The UP and DOWN Keys On The Keyboar
    PRINT "Spacebar Will Advance On Whatever Menu Choice That Is Currently Selecte
    PRINT
    PRINT "See Gunnery Sergeant Jennings If You Need Any Additional Help"
    PRINT "Or Have Any Technical Difficulties"
    PRINT
    PRINT "This Program Creates And Uses Files, Please Do NOT Delete The Following




    PRINT "CADETINFO.SAV and INFO.SAV. CADETINFO Saves All Of Your Files, Deletin
    PRINT "The Same As Deleting All Cadets, Except You Would Have To Run SETUP Aga
    PRINT "INFO Saves The Position Of Your Cadets, Deleting This Would Cause The P
    PRINT "Save New Cadets Over Old Cadets, Deleting The Old Cadets Information In
    PRINT "Process. "
    PRINT
    SLEEP
    GOTO menu

    add:
    CLS
    PRINT info
    INPUT "Cadets First Name: "; firstname$
    INPUT "Cadets Last Name: "; lastname$
    INPUT "Cadets Rank (Abbreviation): "; rank$
    INPUT "LE Class: "; leclass$
    OPEN "cslog.sav" FOR INPUT AS #1
    FOR counter1 = 1 TO 4
    FOR counter2 = 1 TO 200 INPUT #1, cadetinfo(counter1, counter2)
    NEXT
    NEXT
    INPUT #1, info(1)
    CLOSE #1
    PRINT info
    'cadetinfo(1, info) = firstname$
    'cadetinfo(2, info) = lastname$
    'cadetinfo(3, info) = rank$
    'cadetinfo(4, info) = leclass$
    'info = info + 1
    'OPEN "cslog.sav" FOR OUTPUT AS #1
    'FOR counter1 = 1 TO 4
    'FOR counter2 = 1 TO 200
    'WRITE #1, cadetinfo(counter1, counter2)
    'NEXT
    'NEXT
    'WRITE #1, info
    'CLOSE #1

    [/b]

    this is the exact code that i have,so far

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ___ ( http://forcoder.org ) free video tutorials and ebooks about \ R, PHP, MATLAB, Swift, Ruby, Scratch, C, Objective-C, Python, Visual Basic, C#, JavaScript, Go, PL/SQL, Visual Basic .NET, C++, Java, Assembly, Perl, Delphi Apex, F#, Prolog, D, SAS, Fortran, Alice, Dart, Logo, Hack, COBOL, VBScript, Rust, Lua, Bash, FoxPro, Crystal, Scheme, Kotlin, LabVIEW, Clojure, Transact-SQL, Lisp, ML, ABAP, Erlang, Scala, Ada, Julia, Awk \ _____

Sign In or Register to comment.