Type Deklaration

Previous topic - Next topic

mull

TYPE tWaffe
    png
 ENDTYPE
 GLOBAL Img AS tWaffe

 //
 FUNCTION InitGrafiken:
   Img.png = 1
   //LOADSPRITE PrgPfad$ + "Boden_Stein.png" , Img.png
ENDFUNCTION


Kommt dieser Fehler
error : wrong argument type : TYPE  is not declared

Aber Img ist docvh oben als Global deklarier ?t
AMD Phenom II x4 955 Proc. 3.2 GHZ,  4GB Ram
Windows 7 64bit Ultima
NVIDIA GeForce GTX 460
Leistungsindex 5,7

Schranz0r

Hiho :D

Na neuer .... =)

Code (glbasic) Select
TYPE t_Waffe
pic
num
ENDTYPE

LOCAL W AS t_Waffe
LOCAL t_Waffen[] AS t_Waffe


LOCAL Klicks

FOR i = 0 TO 9
W.pic = RND(10)
W.num = i
DIMPUSH t_Waffen[],W
NEXT

FOREACH check IN t_Waffen[]
PRINT check.pic, 10, check.num*10
NEXT

SHOWSCREEN
KEYWAIT
END
um dir mal was simples zu zeigen :)
Also Types in Functionen rein hab ich jetzt noch nicht geschaft, laut Gernot wohl auch nicht möglich, bzw. nicht gut !
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

mull

Quote from: Schranz0rHiho :D

, laut Gernot wohl auch nicht möglich, bzw. nicht gut !
Das ist schade, wenn ich aber was Gobal Deklariere, dann weil ich es immer und ÜBERALL haben will.
AMD Phenom II x4 955 Proc. 3.2 GHZ,  4GB Ram
Windows 7 64bit Ultima
NVIDIA GeForce GTX 460
Leistungsindex 5,7

Schranz0r

Pass mal auf, hab was für dich :D


Code (glbasic) Select
TYPE t_Waffe
pic
num
ENDTYPE

GLOBAL W AS t_Waffe
GLOBAL t_Waffen[] AS t_Waffe

WHILE TRUE

IF timer < GETTIMERALL()
init_pic()
timer = GETTIMERALL()+100
ENDIF

draw_pic()

SHOWSCREEN
WEND
END


FUNCTION init_pic:

GLOBAL nummer
IF W.num < 10
INC nummer,1
W.pic = RND(10)
W.num = nummer
DIMPUSH t_Waffen[],W
ENDIF

ENDFUNCTION

FUNCTION draw_pic:

FOREACH check IN t_Waffen[]
PRINT check.pic, 0, check.num*10
NEXT

ENDFUNCTION
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

Der Code ganz oben geht bei mir. Ich hab' aber ewig viel am Compiler geändert. Kommt diese Woche noch als Update.

mull

@Schranz0r
Jo, das flutscht. Dank dir.
AMD Phenom II x4 955 Proc. 3.2 GHZ,  4GB Ram
Windows 7 64bit Ultima
NVIDIA GeForce GTX 460
Leistungsindex 5,7

Schranz0r

kein Problem...


ach Gernot

Machst du jetzt die arrays automatisch?

also fällt dann ein:

LOCAL Var[] IN typename


weg?
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard