On 13/08/2023 22:47, Alex Farlie via groups.io wrote (cross-posted from the Discussion Group):
How would something like a line:
(which is Pascal/Modula2 style code) be written in BBC Basic for SDL?
I'm not familiar with the Pascal/Modula-2 syntax but I presume the code is equivalent to this in C:
BBC BASIC doesn't have an exact equivalent to the C
-> operator so you have to do it in multiple steps, something like this (where
pGraph is a pointer to a Graph{} structure and
pGraphNode a pointer to a GraphNode{} structure):
Code: Select all
PTR(Graph{}) = pGraph
PTR(GraphNode{}) = Graph.pGraphNode
PRINT GraphNode.NodeWeight
Since this is a BBC BASIC language question, it makes no difference whether it is
BBC BASIC for Windows or
BBC BASIC for SDL 2.0, they implement the same language syntax.