[game,92] 'newChar' cannot be followed by a '.'

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
Shmack
Posts: 25
Joined: Mon Mar 14, 2005 4:28 pm

[game,92] 'newChar' cannot be followed by a '.'

Post by Shmack »

ok it worked befor at school so i printed out the code then rewrote it and now its not working please some one help me soon i needa get this done and im not close to being finshed....

this is what i have so far

Code: Select all

type PlayerStats :
    record
        race : string
        strength, agility, vitality, wizardry : int
    end record


setscreen ("graphics:500;300,nocursor")
var charName : string
function name : string
    var charName : string
    drawline (180, 160, 330, 160, 1)
    drawline (180, 120, 330, 120, 1)
    drawline (180, 160, 180, 120, 1)
    drawline (330, 120, 330, 160, 1)
    locate (10, 25)
    put "Enter your name." ..
    locate (11, 25)
    get charName
    result charName
end name

procedure myStats (myCharacter : PlayerStats, charName : string)
    cls
    %draw stats box
    drawline (320, 260, 320, 100, 1)
    drawline (410, 260, 410, 100, 1)
    drawline (320, 100, 410, 100, 1)
    drawline (420, 260, 320, 260, 1)
    drawline (410, 230, 320, 230, 1)
    drawline (410, 195, 320, 190, 1)
    drawline (410, 160, 320, 160, 1)
    drawline (410, 130, 320, 130, 1)
    drawline (370, 230, 370, 100, 1)
    %Display stats in box
    locate (4, 42)
    put myCharacter.race ..
    locate (6, 48)
    put myCharacter.strength ..
    locate (8, 48)
    put myCharacter.agility ..
    locate (10, 48)
    put myCharacter.vitality ..
    locate (12, 48)
    put myCharacter.wizardry ..
    locate (6, 43)
    put "Str"
    locate (6, 43)
    put "Agi"
    locate (6, 43)
    put "Vit"
    locate (6, 43)
    put "Wiz"
    %stats bar
    drawline (10, 280, 400, 280, 1)
    drawline (10, 280, 10, 500, 1)
    drawline (400, 280, 400, 300, 1)
    locate (1, 3)
    put charName, myCharacter.race, " HP:", myCharacter.vitality * 1.5, 
        " SP:", myCharacter.wizardry * 2.2, " EXP:", "100", " z", "100000" ..
end myStats

function selectRace : PlayerStats
    var choice : int
    var newChar : int
    loop
        cls
        %border around chars
        drawline (370, 270, 230, 270, 1)
        drawline (230, 240, 230, 270, 1)
        drawline (370, 240, 370, 270, 1)
        drawline (130, 240, 130, 100, 1)
        drawline (490, 100, 130, 100, 1)
        drawline (490, 240, 490, 100, 1)
        drawline (490, 240, 130, 240, 1)
        locate (3, 30)
        %Chars
        put "pick your race." ..
        locate (6, 20)
        put "1-Human (Str: 15 Agi: 15 Vit: 15 Wiz: 15)"
        locate (6, 20)
        put "1-Night Elf (Str: 15 Agi: 20 Vit: 10 Wiz: 15)"
        locate (6, 20)
        put "1-Orc (Str: 20 Agi: 10 Vit: 20 Wiz: 10)"
        locate (6, 20)
        put "1-Undead (Str: 10 Agi: 10 Vit: 20 Wiz: 20)"
        locate (4, 30)
        get choice
        %Choices of chars with status
        case choice of
            label 1 :
                newChar.race := "Human"
                newChar.strength := 15
                newChar.agility := 15
                newChar.vitality := 15
                newChar.wizardry := 15
                exit
            label 2 :
                newChar.race := "Night Elf"
                newChar.strength := 15
                newChar.agility := 20
                newChar.vitality := 10
                newChar.wizardry := 15
                exit
            label 3 :
                newChar.race := "Orc"
                newChar.strength := 20
                newChar.agility := 10
                newChar.vitality := 20
                newChar.wizardry := 10
                exit
            label 4 :
                newChar.race := "Undead"
                newChar.strength := 10
                newChar.agility := 10
                newChar.vitality := 20
                newChar.wizardry := 20
                exit

            label :
                put : "Please select a number from 1-4."
        end case
    end loop
    result newChar
end selectRace
charName := name
var myCharacter := selectRace
myStats (myCharacter, charName)
[code] 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:3418, old post ID:27508[/size][/color]
User avatar
rovingcowboy
Posts: 1504
Joined: Wed Dec 18, 2002 10:14 pm

[game,92] 'newChar' cannot be followed by a '.'

Post by rovingcowboy »

what's it doing?

not loading at all?

if not try clearing your cache and see if that fixes the trouble of not loading.

the old one might be in the cache yet and could be confusing the system? :blink:

also look for any mis typed commands that is common in re typing something.

oh hey sorry this is the programming room, :bsod: :o i just clicked on the new messages.

sorry let me get outta this room as i am not able to program... :bsod:


Archived topic from Iceteks, old topic ID:3418, old post ID:27516
roving cowboy/ keith
Locked