Main forum > Bug Reports

Latest Steam Update Broke My Project

<< < (2/2)

bigsofty:
 The Steam version (not beta) is GLBasic Precompiler V.17.200, this is the current Steam Release version, that was updated at the weekend to  V.17.200.

... I just downloaded the beta which is GLBasic Precompiler V.17.312. I am now getting a new error.

"protoList.gbas"(73) error : GPC0007 wrong argument type :


--- Code: (glbasic) --- FUNCTION SET_F: F[] AS TGOProto
self.F = F // <------------ This is line 73
ENDFUNCTION // Full array swap

--- End code ---

F[] is just an array within a type.

I must stress that I haven't used this Beta, the last one I used was a couple of weeks ago and I was getting some errors then. I will mirror what you have done Gernot and do a separate compile on the previous code to see if that piece of is now compiling on the new beta.

bigsofty:
I just tried the code I posted(The full TMaterials type in Reply #3 above) on the beta GLBasic Precompiler V.17.312 and it compiles, which is great!  That very reassuring TBH. =D

I haven't executed it as its pretty out of context but the Precompiler usually does an excellent runtime error prevention I'm sure it will be fine.

Seems "self.F" above is still causing further errors though.



EDIT:

Here is the modified type showing the ".self=" error...

See... "FUNCTION AddBuggedFunc:"


--- Code: (glbasic) ---TYPE TMaterials

filename$
totalMaterials%
m[] AS TMaterial

FUNCTION SetUp:
DIM self.m[0]
self.Update()
ENDFUNCTION

FUNCTION Update:
self.totalMaterials%=LEN(self.m[])
ENDFUNCTION

FUNCTION Render:
ENDFUNCTION

FUNCTION Destroy:
DIM self.m[0]
self.Update()
ENDFUNCTION

FUNCTION ReadFile: filename$
LOCAL f%,l$
LOCAL n%,t$[]
LOCAL i%
LOCAL m AS TMaterial
self.Destroy()
self.SetUp()
f%=GENFILE()
OPENFILE(f%, filename$, TRUE)
//DEBUG "Start read TMaterials.ReadFile("+filename$+") file >\n"
REPEAT
READLINE f%, l$
n%=SPLITSTR(l$,t$[]," ")
IF LEN(t$[])=0 THEN CONTINUE
SELECT t$[0]
CASE "newmtl"
DIMPUSH self.m[], m
self.m[-1].name$=t$[1]
CASE "Kd"
self.m[-1].red# = t$[1]; self.m[-1].green# = t$[2]; self.m[-1].blue# = t$[3]
CASE "Tr"
self.m[-1].alpha# = t$[1]
CASE "Ns"
self.m[-1].size# = t$[1]
CASE "#"
DEFAULT
ENDSELECT
UNTIL ENDOFFILE(f%)

FOREACH m IN self.m[] // <------------------- THIS IS LINE 82
m.combined% = ASL((m.alpha#)*255,24)+ASL(m.blue#*255,16)+ASL(m.green#*255,8) + m.red#*255
NEXT
//DEBUG "< End read material file\n"

CLOSEFILE f%
ENDFUNCTION

FUNCTION GetMaterialIndex%: findname$
LOCAL matIndex%=0
FOREACH mat IN self.m[]
IF mat.name$ = findname$ THEN BREAK
INC matIndex%
NEXT
IF matIndex%=LEN(self.m[])
// myDEBUG ( "Error in GetMaterialIndex(): Material '"+findname$+"', not found!\n" )
END
RETURN -1
ENDIF
RETURN matIndex%
ENDFUNCTION

//*************************************** ERROR ************************************

FUNCTION AddBuggedFunc: matArray[] AS TMaterial
self.m[] = matArray
ENDFUNCTION

//***********************************************************************************

ENDTYPE


TYPE TMaterial
name$
red#
blue#
green#
alpha# = 1.0
combined% = 0xffffffff
size# = 32
text$[]
ENDTYPE


--- End code ---

Kitty Hello:
For a quick fix, please write (old style) self.m[] = matArray[] // <-- the final braces are the problem. Don't omit so far.

bigsofty:
That's the last error message squashed well done Gernot!  :enc:

As you can tell this is quite a relief, I've a very large project and I was was trying to keep proper working hours with it. So each day missed was a days work lost. But all's good now, I can jump back in.  :good:

One thing I noticed here though, is that maybe I should take more of an active roll in beta updates. If there is any beta updates posted in the future, drop me a message please and I'll happily run it through my behemoth of a project to test the compiler and also provide some feedback.

Navigation

[0] Message Index

[*] Previous page

Go to full version