1

In VB you can both define and assign a value to a variable in one line.

Can you do this in Basic4Android?

VB code sample:

Dim strMyVariable As String = "Some text is in here"

Update: I tried this and got the following error:

NumberOfColumns As Int = 5  ' Number of columns.

Compiling code.                         Error
Error compiling program.
Error description: '=' expected.
Occurred on line: 13
NumberOfColumns As Int = 5' Number of columns.
Word: numberofcolumns

Update:

Compiling code.                         Error
Error compiling program.
Error description: Syntax error.
Occurred on line: 13
Dim NumberOfColumns As Int = 5 ' Number of columns.
Word: int
Emad-ud-deen
  • 4,734
  • 21
  • 87
  • 152

1 Answers1

2

AFAICT, you can't.

If you really feel you need to do it on the same line, you can do it like this:

Dim NumberOfColumns As Int: NumberOfColumns = 5

The colon is defined in the user's guide (page 111) as the "separator for two statements on the same line".

Ken White
  • 123,280
  • 14
  • 225
  • 444