How do I write multiple statements on a single line?

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
ak2766
Newbie
Posts: 19
Joined: Sun Apr 03, 2022 4:59 am
Location: Melbourne, Australia

How do I write multiple statements on a single line?

Post by ak2766 »

In BASH, I can chain multiple commands using

Code: Select all

;
Is this possible?

I was trying to do something similar to:
      startX = 127; lastX = 0; stepX = -1
      startY = 1; lastY = 127; stepY = 1


But I've been forced to do:
  startX = 127
  lastX = 0
  stepX = -1
  startY = 1
  lastY = 127
  stepY = 1


Since I have to do this 9 times to handle horizontal/vertical/diagonals/center. They both look messy but I was hoping to constrain the ugliness to a few lines - ;) .
BruceSteers
Legend
Posts: 2110
Joined: Thu Jul 23, 2020 5:20 pm
Location: Isle of Wight

Re: How do I write multiple statements on a single line?

Post by BruceSteers »

It's not possible I'm afraid.

But doing something like that nine times can often be turned into a function or done in a loop.
Post Reply