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
Posts: 19
Joined: Sunday 3rd April 2022 4:59am
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 - ;) .
User avatar
BruceSteers
Posts: 1689
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

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.
If at first you don't succeed , try doing something differently.
BruceS
Post Reply