Main Menu

News:

SyntaxBoom, now with pwetty syntax highlighted code boxes! \o/ 

https://www.syntaxboom.com/forum/index.php?topic=96

Shoutbox

Jackdaw

Today at 22:07:30
Well you learn something new every day. There is a fork of Blender 3D called Bforartists, that has a much better GUI than Blender's own. You'll find the link to it in the new github page in found in https://www.syntaxboom.com/forum/index.php?topic=25.0

Baggey

2025-09-24, 17:57:11
They'll be using Expanding foam to glue bricks together next  :-X

Dabzy

2025-09-24, 06:09:52
You can also get the expanding foam post fix, but, I wouldnt trust it really, especially where I live on the side of a valley and when the storms blow in the right direction, whistling down the valley, nowt is safe!

Baggey

2025-09-23, 08:53:01
That Postcrete stuff is amazing. I never know how much water to add. May be i should read the Instructions  ;D 

Dabzy

2025-09-22, 21:33:46
Cannot beat a breaky uppy mode, saves the hand cramps and chipped knuckles knocking ten bells out of a chod of conc with a hammer and chisel.

GfK

2025-09-22, 21:28:44
I have a massive JCB drill with a concrete breaky uppy mode which has got me out of jail free a couple of times replacing rotted fence posts that has been concreted in.

Amon

2025-09-22, 19:23:30
What about Roly?

Dabzy

2025-09-22, 19:22:35
Putting my 2 deckings in.... I've dug enough post holes to last me a life time... I feel sorry for the future poor sod who may want to shift'em... Like most things I do, I tend to go over the top, and as such, I've probably got shares in postcrete! :D

GfK

2025-09-22, 19:10:57
Round is a shape.

Baggey

2025-09-22, 19:04:49
Consult a qualified electrician for compliance with BS 7671 and local building Regs! Avoid areas where future digging is likely. ;)

Members
  • Total Members: 55
  • Latest: Amon
Stats
  • Total Posts: 1,608
  • Total Topics: 198
  • Online today: 13
  • Online ever: 54 (Sep 14, 2025, 08:48 AM)
Users Online
  • Users: 0
  • Guests: 6
  • Total: 6
Welcome to SyntaxBoom. Please login or sign up.

Recent

custom types basics

Started by RemiD, Jun 13, 2025, 09:31 AM

Previous topic - Next topic

RemiD

to better understand how the commands first, last, after, before, handle, object, work with bb custom types :

;custom types basics 20230907
;look at the debuglog to understand what is happening...
Graphics3D( 640, 480, 32, 2 )

;custom type list
Type Tthing
 Field name$
 Field mesh
End Type

;create some instances in the list
thi.Tthing = New Tthing : thi\name = "pomme" : thi\mesh = CreateSphere(8)
thi.Tthing = New Tthing : thi\name = "poire" : thi\mesh = CreateSphere(8)
thi.Tthing = New Tthing : thi\name = "peche" : thi\mesh = CreateSphere(8)
thi.Tthing = New Tthing : thi\name = "orange" : thi\mesh = CreateSphere(8)
thi.Tthing = New Tthing : thi\name = "banane" : thi\mesh = CreateCylinder(8)
thi.Tthing = New Tthing : thi\name = "kiwi" : thi\mesh = CreateSphere(8)

;loop trhought the list
DebugLog("")
For thi.Tthing = Each Tthing
 DebugLog(thi\name)
Next

;go to the first in the list
DebugLog("")
thi.Tthing = First Tthing 
DebugLog(thi\name)

;go to the last in the list
DebugLog("")
thi.Tthing = Last Tthing 
DebugLog(thi\name)

;browse the list from first to last
DebugLog("")
thi.Tthing = First Tthing 
Repeat
 ;If( KeyHit(57)=True )
  DebugLog(thi\name)
  thi.Tthing = After thi
 ;EndIf
Until( thi.Tthing = Null )

;browse the list from last to first
DebugLog("")
thi.Tthing = Last Tthing 
Repeat
 ;If( KeyHit(57)=True )
  DebugLog(thi\name)
  thi.Tthing = Before thi
 ;EndIf
Until( thi.Tthing = Null )

;delete an instance in the list
c% = Rand(1,6)
count% = 0
For thi.Tthing = Each Tthing
 count = count + 1
 If( count = c )
  Delete( thi ) ;delete this instance
  DebugLog( thi\name ) ;'object does not exist' 
 EndIf
Next

;get the handle of each instance and put it in the entityname of each mesh
For thi.Tthing = Each Tthing
 NameEntity( thi\mesh, Handle(thi) )
Next

;get the handle in the entityname of a mesh (after a collision or after a linepick), an to retrieve the instance in the list
pickedEnt% = LinePick( sc, sy, sz, vx, vy, vz, radius )
thiH% = EntityName( pickedEnt )
thi.Tthing = Object.Tthing( thiH )
EntityColor( thi\mesh, 000, 000, 250 )

WaitKey()

End()